pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Fujii Masao <fujii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pgbench: Fix assertion failure with retriable errors in pipeline
Date: Fri, 26 Sep 2025 12:26:36 +0000
Message-ID: <E1v27X2-000AWF-0W@gemulon.postgresql.org> (raw)

pgbench: Fix assertion failure with retriable errors in pipeline mode.

When running pgbench with --verbose-errors option and a custom script that
triggered retriable errors (e.g., serialization errors) in pipeline mode,
an assertion failure could occur:

    Assertion failed: (sql_script[st->use_file].commands[st->command]->type == 1), function commandError, file pgbench.c, line 3062.

The failure happened because pgbench assumed these errors would only occur
during SQL commands, but in pipeline mode they can also happen during
\endpipeline meta command.

This commit fixes the assertion failure by adjusting the assertion check to
allow such errors during either SQL commands or \endpipeline.

Backpatch to v15, where the assertion check was introduced.

Author: Yugo Nagata <nagata@sraoss.co.jp>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAHGQGwGWQMOzNkQs-LmpDHdNC0h8dmAuUMRvZrEntQi5a-b=Kg@mail.gmail.com

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/8b2e290bde21767373df9eef4b14bba282df8bdb

Modified Files
--------------
src/bin/pgbench/pgbench.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)



view thread (8+ messages)  latest in thread

Message-ID: <E1v27X2-000AWF-0W@gemulon.postgresql.org>
Permalink:  ../E1v27X2-000AWF-0W@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1v27X2-000AWF-0W@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: fujii@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: pgbench: Fix assertion failure with retriable errors in pipeline
  In-Reply-To: <E1v27X2-000AWF-0W@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox