pgsql: Fix assertion failure in pgbench when handling multiple pipeline - Mailing list pgsql-committers

From Fujii Masao
Subject pgsql: Fix assertion failure in pgbench when handling multiple pipeline
Date
Msg-id E1uiNv3-000ShX-15@gemulon.postgresql.org
Whole thread Raw
List 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.fujii@gmail.com>
Reviewed-by: Tatsuo Ishii <ishii@postgresql.org>
Discussion: https://postgr.es/m/CAHGQGwFAX56Tfx+1ppo431OSWiLLuW72HaGzZ39NkLkop6bMzQ@mail.gmail.com
Backpatch-through: 15

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/12efa48978c6dba5eca1b95758127181783fb217

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


pgsql-committers by date:

Previous
From: Jeff Davis
Date:
Subject: pgsql: Simplify options in pg_dump and pg_restore.
Next
From: Fujii Masao
Date:
Subject: pgsql: Fix assertion failure in pgbench when handling multiple pipeline