Re: Suggestion to add --continue-client-on-abort option to pgbench
Rintaro Ikeda <ikedarintarof@oss.nttdata.com>
From: Rintaro Ikeda <ikedarintarof@oss.nttdata.com>
To: Yugo Nagata <nagata@sraoss.co.jp>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
"slpmcf@gmail.com" <slpmcf@gmail.com>,
"boekewurm+postgres@gmail.com" <boekewurm+postgres@gmail.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>,
Srinath Reddy Sadipiralla <srinath2133@gmail.com>,
Dilip Kumar <dilipbalaut@gmail.com>
Date: 2025-07-18T08:07:53Z
Lists: pgsql-hackers
Hi,
On 2025/07/16 22:49, Yugo Nagata wrote:
>> I think we should also change the error message in pg_log_error. I modified the
>> patch v8-0003 as follows:
>> @@ -3383,8 +3383,8 @@ readCommandResponse(CState *st, MetaCommand meta, char
>> *varprefix)
>>
>> default:
>> /* anything else is unexpected */
>> - pg_log_error("client %d script %d aborted in
>> command %d query %d: %s",
>> - st->id, st->use_file,
>> st->command, qrynum,
>> + pg_log_error("client %d aborted in command %d
>> query %d of script %d: %s",
>> + st->id, st->command,
>> qrynum, st->use_file,
>> PQerrorMessage(st->con));
>> goto error;
>> }
>>
>> With this change, the output now is like this:
>>> pgbench: error: client 0 aborted in command 1 query 0 of script 0: ERROR:
>> duplicate key value violates unique constraint "test_col2_key"
>>
>> I want hear your thoughts.
>
> My idea is to modify this as follows;
>
> default:
> /* anything else is unexpected */
> - pg_log_error("client %d script %d aborted in command %d query %d: %s",
> - st->id, st->use_file, st->command, qrynum,
> - PQerrorMessage(st->con));
> + commandFailed(st, "SQL", PQerrorMessage(st->con));
> goto error;
> }
>
> This fix is originally planned to be included in patch v8, but was missed.
> It is now included in the attached patch, v10.
>
> With this change, the output becomes:
>
> pgbench: error: client 0 aborted in command 0 (SQL) of script 0;
> ERROR: duplicate key value violates unique constraint "t2_pkey"
>
> Although there is a slight difference, the message is essentially the same as
> your proposal. Also, I believe the use of commandFailed() makes the code simpler
> and more consistent.
>
> What do you think?
>
Thank you for the new patch! I think Nagata-san's v10 patch is a clear
improvement over my v9 patch. I'm happy with the changes.
>> Also, let me ask one question. In this case, I directly modified your commit in
>> the v8-0003 patch. Is that the right way to update the patch?
>
> I’m not sure if that’s the best way, but I think modifying the patch directly is a
> valid way to propose an alternative approach during discussion, as long as the original
> patch is respected. It can often help clarify suggestions.
I understand that. Thank you.
Regards,
Rintaro Ikeda
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
pgbench: Fix assertion failure with multiple \syncpipeline in pipeline mode.
- 5bc251b28839 17.8 landed
- 00e64e35c8bd 18.2 landed
- 4aa0ac05765e 19 (unreleased) landed
-
pgbench: Add --continue-on-error option.
- 0ab208fa505c 19 (unreleased) landed
-
Fix "inconsistent DLL linkage" warning on Windows MSVC
- a3ea5330fcf4 19 (unreleased) cited
-
pgbench: Fix error reporting in readCommandResponse().
- 7d7e81d1e6b8 13.23 landed
- cb21e1f92fb3 14.20 landed
- bdccb6302871 15.15 landed
- 36c4d30c8f24 16.11 landed
- a912118c6055 17.7 landed
- 29aabbc43269 18.1 landed
- 19d4f9ffc207 19 (unreleased) landed
-
pgbench: Fix assertion failure with retriable errors in pipeline mode.
- 704f517711b4 15.15 landed
- 8b2e290bde21 16.11 landed
- f39d9164b70a 17.7 landed
- c736808e03b7 18.1 landed
- 8bb174295e89 19 (unreleased) landed
-
Allow pgbench to retry in some cases.
- 4a39f87acd6e 15.0 cited