postgresql/src/bin/pgbench
Fujii Masao fee46ab4f2 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
2025-08-03 10:49:54 +09:00
..
t Apply more consistent style for command options in TAP tests 2025-03-17 12:42:23 +09:00
.gitignore Build all Flex files standalone 2022-09-04 12:09:01 +07:00
exprparse.y Return yyparse() result not via global variable 2025-01-24 06:55:39 +01:00
exprscan.l Get rid of O(N^2) script-parsing overhead in pgbench. 2025-02-27 10:53:38 -05:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
pgbench.c Fix assertion failure in pgbench when handling multiple pipeline sync messages. 2025-08-03 10:49:54 +09:00
pgbench.h pg_noreturn to replace pg_attribute_noreturn() 2025-03-13 12:37:26 +01:00