Re: Suggestion to add --continue-client-on-abort option to pgbench
Rintaro Ikeda <ikedarintarof@oss.nttdata.com>
From: ikedarintarof <ikedarintarof@oss.nttdata.com>
To: Srinath Reddy Sadipiralla <srinath2133@gmail.com>,
Dilip Kumar <dilipbalaut@gmail.com>
Cc: slpmcf@gmail.com,
boekewurm+postgres@gmail.com,
pgsql-hackers@postgresql.org
Date: 2025-06-02T14:21:28Z
Lists: pgsql-hackers
Hi, hakers.
> On Tue, May 13, 2025 at 11:27 AM Dilip Kumar <dilipbalaut@gmail.com <mailto:dilipbalaut@gmail.com>> wrote:
>>
>> 1. You need to update the stats for this new counter in the
>> "accumStats()" function.
>>
>> 2. IMHO, " continue-on-error " is more user-friendly than
>> "continue-client-on-error".
>>
>> 3. There are a lot of whitespace errors, so those can be fixed. You
>> can just try to apply using git am, and it will report those
>> whitespace warnings. And for fixing, you can just use
>> "--whitespace=fix" along with git am.
> On May 14, 2025, at 18:08, Srinath Reddy Sadipiralla <srinath2133@gmail.com> wrote:
>
> Here's the diff for the missing usage information for this option and as Dilip mentioned updating the new counter in the "accumStats()" function.
Thank you very much for the helpful comments, and apologies for my delayed reply.
I've updated the patch based on your suggestions:
- Modified name of the option.
- Added the missing explanation.
- Updated the new counter in the `accumStats()` function as pointed out.
- Fixed the whitespace issues.
Additionally, I've included documentation for the new option.
I'm submitting this updated patch to the current CommitFest.
Best Regards,
Rintaro Ikeda

> On May 14, 2025, at 18:08, Srinath Reddy Sadipiralla <srinath2133@gmail.com> wrote:
>
>
> Hi,
>
> On Tue, May 13, 2025 at 11:27 AM Dilip Kumar <dilipbalaut@gmail.com <mailto:dilipbalaut@gmail.com>> wrote:
>> On Tue, May 13, 2025 at 9:20 AM <Rintaro.Ikeda@nttdata.com <mailto:Rintaro.Ikeda@nttdata.com>> wrote:
>> > I also appreciate you for pointing out my mistakes in the previous version of the patch. I fixed the duplicated lines. I’ve attached the updated patch.
>> >
>> This is a useful feature, so +1 from my side. Here are some initial
>> comments on the patch while having a quick look.
>>
>> 1. You need to update the stats for this new counter in the
>> "accumStats()" function.
>>
>> 2. IMHO, " continue-on-error " is more user-friendly than
>> "continue-client-on-error".
>>
>> 3. There are a lot of whitespace errors, so those can be fixed. You
>> can just try to apply using git am, and it will report those
>> whitespace warnings. And for fixing, you can just use
>> "--whitespace=fix" along with git am.
>
>
> Hi, +1 for the idea. I’ve reviewed and tested the patch. Aside from Dilip’s feedback and the missing usage information for this option, the patch LGTM.
>
> Here's the diff for the missing usage information for this option and as Dilip mentioned updating the new counter in the "accumStats()" function.
>
> diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c
> index baaf1379be2..20d456bc4b9 100644
> --- a/src/bin/pgbench/pgbench.c
> +++ b/src/bin/pgbench/pgbench.c
> @@ -959,6 +959,8 @@ usage(void)
> " --log-prefix=PREFIX prefix for transaction time log file\n"
> " (default: \"pgbench_log\")\n"
> " --max-tries=NUM max number of tries to run transaction (default: 1)\n"
> + " --continue-client-on-error\n"
> + " Continue and retry transactions that failed due to errors other than serialization or deadlocks.\n"
> " --progress-timestamp use Unix epoch timestamps for progress\n"
> " --random-seed=SEED set random seed (\"time\", \"rand\", integer)\n"
> " --sampling-rate=NUM fraction of transactions to log (e.g., 0.01 for 1%%)\n"
> @@ -1522,6 +1524,9 @@ accumStats(StatsData *stats, bool skipped, double lat, double lag,
> case ESTATUS_DEADLOCK_ERROR:
> stats->deadlock_failures++;
> break;
> + case ESTATUS_OTHER_SQL_ERROR:
> + stats->other_sql_failures++;
> + break;
> default:
> /* internal error which should never occur */
> pg_fatal("unexpected error status: %d", estatus);
> --
> Thanks,
> Srinath Reddy Sadipiralla
> EDB: https://www.enterprisedb.com/
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