]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix assertion failure in pgbench when handling multiple pipeline sync messages.
authorFujii Masao <fujii@postgresql.org>
Sun, 3 Aug 2025 01:50:22 +0000 (10:50 +0900)
committerFujii Masao <fujii@postgresql.org>
Sun, 3 Aug 2025 01:50:22 +0000 (10:50 +0900)
commit1d3ded521a0be7f46dde132053d876ec1cad2784
tree48a3bb7f77aebb779eb34f365b0ad09f7f09246f
parentcd45fef058abc412ee3595cced5b68c4957f0499
Fix assertion failure in pgbench when handling multiple pipeline sync messages.

Previously, when running pgbench in pipeline mode with a custom script
that triggered retriable errors (e.g., serialization errors),
an assertion failure could occur:

    Assertion failed: (res == ((void*)0)), function discardUntilSync, file pgbench.c, line 3515.

The root cause was that pgbench incorrectly assumed only a single
pipeline sync message would be received at the end. In reality,
multiple pipeline sync messages can be sent and must be handled properly.

This commit fixes the issue by updating pgbench to correctly process
multiple pipeline sync messages, preventing the assertion failure.

Back-patch to v15, where the bug was introduced.

Author: Fujii Masao <masao.fujii@gmail.com>
Reviewed-by: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://postgr.es/m/CAHGQGwFAX56Tfx+1ppo431OSWiLLuW72HaGzZ39NkLkop6bMzQ@mail.gmail.com
Backpatch-through: 15
src/bin/pgbench/pgbench.c