RE: Suggestion to add --continue-client-on-abort option to pgbench
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Yugo Nagata' <nagata@sraoss.co.jp>
Cc: 'Rintaro Ikeda' <ikedarintarof@oss.nttdata.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-06-26T05:45:12Z
Lists: pgsql-hackers
Dear Nagata-san,
> As I understand it, the current patch aims to allow continuation only after
> SQL-level
> errors, such as constraint violations. That seems reasonable, as it can simulate
> the
> behavior of applications that ignore or retry such errors (even though retries are
> not
> implemented in the current patch).
Yes, no one has objections to retry in this case. This is a main part of the proposal.
> However, I'm not sure it's reasonable to allow continuation after other types of
> errors,
> such as misuse of meta-commands or unexpected errors during their execution,
> since these
> wouldn't simulate any real application behavior and would more likely indicate a
> failure
> in the benchmarking process itself.
I have a concern for \gset metacommand.
According to the doc and source code, \gset assumed that executed command surely
returns a tuple:
```
if (meta == META_GSET && ntuples != 1)
{
/* under \gset, report the error */
pg_log_error("client %d script %d command %d query %d: expected one row, got %d",
st->id, st->use_file, st->command, qrynum, PQntuples(res));
st->estatus = ESTATUS_META_COMMAND_ERROR;
goto error;
}
```
But sometimes the SQL may not be able to return tuples or return multiple ones due
to the concurrent transactions. I feel retrying the transaction is very useful
in this case.
Anyway, we must confirm the opinion from the proposer.
[1]: https://github.com/ryogrid/tpcc_like_with_pgbench
Best regards,
Hayato Kuroda
FUJITSU LIMITED
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