pgsql: Fix assertion failure in pgbench when handling multiple pipeline

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix assertion failure in pgbench when handling multiple pipeline
Date: 2025-08-03 01:55:01
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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(dot)fujii(at)gmail(dot)com>
Reviewed-by: Tatsuo Ishii <ishii(at)postgresql(dot)org>
Discussion: https://postgr.es/m/CAHGQGwFAX56Tfx+1ppo431OSWiLLuW72HaGzZ39NkLkop6bMzQ@mail.gmail.com
Backpatch-through: 15

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/6914a330f019feab9fb90fc7d79c93e24ca3193f

Modified Files
--------------
src/bin/pgbench/pgbench.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2025-08-03 02:00:50 pgsql: Suppress complaints about leaks in TS dictionary loading.
Previous Message Fujii Masao 2025-08-03 01:54:43 pgsql: Fix assertion failure in pgbench when handling multiple pipeline