Re: Suggestion to add --continue-client-on-abort option to pgbench

From: Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>
To: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
Cc: ikedarintarof <ikedarintarof(at)oss(dot)nttdata(dot)com>, "slpmcf(at)gmail(dot)com" <slpmcf(at)gmail(dot)com>, "boekewurm+postgres(at)gmail(dot)com" <boekewurm+postgres(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Srinath Reddy Sadipiralla <srinath2133(at)gmail(dot)com>, Dilip Kumar <dilipbalaut(at)gmail(dot)com>
Subject: Re: Suggestion to add --continue-client-on-abort option to pgbench
Date: 2025-06-30 06:02:36
Message-ID: 20250630150236.b4c66a1498666011a77fde16@sraoss.co.jp
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, 27 Jun 2025 10:59:09 +0000
"Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com> wrote:

> > > Retrying the failed transaction is not necessary when the transaction
> > > failed due to SQL-level errors. Unlike real-world applications, pgbench
> > > does not need to complete specific transaction successfully. In the case
> > > of unique constraint violations, retrying the same transaction will
> > > likely to result in the same error again.
>
> I intended here that clients could throw away the failed transaction and start
> new one again in the case. I hope we are on the same page...

Could I confirm what you mean by "start new one"?

In the current pgbench, when a query raises an error (a deadlock or
serialization failure), it can be retried using the same random state.
This typically means the query will be retried with the same parameter values.

On the other hand, when the query ultimately fails (possibly after some retries),
the transaction is marked as a "failure", and the next transaction starts with a
new random state (i.e., with new parameter values).

Therefore, if a query fails due to a unique constraint violation and is retried
with the same parameters, it will keep failing on each retry.

Regards,
Yugo Nagata

--
Yugo Nagata <nagata(at)sraoss(dot)co(dot)jp>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2025-06-30 06:07:15 Re: Skipping schema changes in publication
Previous Message Masahiko Sawada 2025-06-30 06:00:45 Re: Make COPY format extendable: Extract COPY TO format implementations