pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tatsuo Ishii <ishii@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allow pgbench to retry in some cases.
Date: Wed, 23 Mar 2022 10:06:50 +0000
Message-ID: <E1nWxtC-0010KS-07@gemulon.postgresql.org> (raw)

Allow pgbench to retry in some cases.

When serialization or deadlock errors are reported by backend, allow
to retry and continue the benchmarking. For this purpose new options
"--max-tries", "--failures-detailed" and "--verbose-errors" are added.

Transactions with serialization errors or deadlock errors will be
repeated after rollbacks until they complete successfully or reach the
maximum number of tries (specified by the --max-tries option), or the
maximum time of tries (specified by the --latency-limit option).
These options can be specified at the same time. It is not possible to
use an unlimited number of tries (--max-tries=0) without the
--latency-limit option or the --time option. By default the option
--max-tries is set to 1, which means transactions with
serialization/deadlock errors are not retried. If the last try fails,
this transaction will be reported as failed, and the client variables
will be set as they were before the first run of this transaction.

Statistics on retries and failures are printed in the progress,
transaction / aggregation logs and in the end with other results (all
and for each script). Also retries and failures are printed
per-command with average latency by using option
(--report-per-command, -r).

Option --failures-detailed prints group failures by basic types
(serialization failures / deadlock failures).

Option --verbose-errors prints distinct reports on errors and failures
(errors without retrying) by type with detailed information like which
limit for retries was violated and how far it was exceeded for the
serialization/deadlock failures.

Patch originally written by Marina Polyakova then Yugo Nagata
inherited the discussion and heavily modified the patch to make it
commitable.

Authors: Yugo Nagata, Marina Polyakova
Reviewed-by: Fabien Coelho, Tatsuo Ishii, Alvaro Herrera, Kevin Grittner, Andres Freund, Arthur Zakirov, Alexander Korotkov, Teodor Sigaev, Ildus Kurbangaliev
Discussion: https://postgr.es/m/flat/72a0d590d6ba06f242d75c2e641820ec%40postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4a39f87acd6e681e5ded1239391d8a92645b43d6

Modified Files
--------------
doc/src/sgml/ref/pgbench.sgml                |  431 ++++++++--
src/bin/pgbench/pgbench.c                    | 1128 ++++++++++++++++++++++----
src/bin/pgbench/t/001_pgbench_with_server.pl |  215 ++++-
src/bin/pgbench/t/002_pgbench_no_server.pl   |   10 +
src/fe_utils/conditional.c                   |   16 +-
src/include/fe_utils/conditional.h           |    2 +
6 files changed, 1594 insertions(+), 208 deletions(-)



Message-ID: <E1nWxtC-0010KS-07@gemulon.postgresql.org>
Permalink:  ../E1nWxtC-0010KS-07@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1nWxtC-0010KS-07@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: ishii@postgresql.org
  Subject: Re: pgsql: Allow pgbench to retry in some cases.
  In-Reply-To: <E1nWxtC-0010KS-07@gemulon.postgresql.org>
  References: <E1nWxtC-0010KS-07@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox