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: Fujii Masao <masao.fujii@gmail.com>, Yugo Nagata <nagata@sraoss.co.jp>
Cc: Chao Li <li.evan.chao@gmail.com>,
Jakub Wartak <jakub.wartak@enterprisedb.com>,
"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-10-19T13:12:37Z
Lists: pgsql-hackers
Attachments
- v17-0002-pgbench-Add-continue-on-error-option.patch (text/plain) patch v17-0002
Hi,
On 2025/10/02 1:22, Fujii Masao wrote:
> Regarding 0002:
>
> - if (canRetryError(st->estatus))
> + if (continue_on_error || canRetryError(st->estatus))
> {
> if (verbose_errors)
> commandError(st, PQresultErrorMessage(res));
> goto error;
>
> With this change, even non-SQL errors (e.g., connection failures) would
> satisfy the condition when --continue-on-error is set. Isn't that a problem?
> Shouldn't we also check that the error status is one that
> --continue-on-error is meant to handle?
I agree that connection failures should not be ignored even when
--continue-on-error is specified.
For now, I’m not sure if other cases would cause issues, so the updated patch
explicitly checks the connection status and emits an error message when the
connection is lost.
>
>
> + * Without --continue-on-error:
> *
> * failed (the number of failed transactions) =
> * 'serialization_failures' (they got a serialization error and were not
> * successfully retried) +
> * 'deadlock_failures' (they got a deadlock error and were not
> * successfully retried).
> *
> + * With --continue-on-error:
> + *
> + * failed (number of failed transactions) =
> + * 'serialization_failures' + 'deadlock_failures' +
> + * 'other_sql_failures' (they got some other SQL error; the transaction was
> + * not retried and counted as failed due to --continue-on-error).
>
> About the comments on failed transactions: I don't think we need
> to split them into separate "with/without --continue-on-error" sections.
> How about simplifying them like this?
>
>
> ------------------------
> * failed (the number of failed transactions) =
> * 'serialization_failures' (they got a serialization error and were not
> * successfully retried) +
> * 'deadlock_failures' (they got a deadlock error and were not
> * successfully retried) +
> * 'other_sql_failures' (they failed on the first try or after retries
> * due to a SQL error other than serialization or
> * deadlock; they are counted as a failed transaction
> * only when --continue-on-error is specified).
> ------------------------
>
Thank you for the suggestion. I’ve updated the comments as you proposed.
>
> * 'retried' (number of all retried transactions) =
> * successfully retried transactions +
> * failed transactions.
>
> Since transactions that failed on the first try (i.e., no retries) due to
> an SQL error are not counted as 'retried', shouldn't this source comment
> be updated?
Agreed. I added "failed transactions" is actually counted when they are retied.
I've attached the updated patch v17-0002. 0003 remains unchanged.
Best 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