pgsql: pgbench: introduce a RandomState struct

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: pgbench: introduce a RandomState struct
Date: 2018-11-16 19:35:58
Message-ID: E1gNjuI-0001YZ-9v@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

pgbench: introduce a RandomState struct

This becomes useful when used to retry a transaction after a
serialization error or deadlock abort. (We don't yet have that feature,
but this is preparation for it.)

While at it, use separate random state for thread administratrivia such
as deciding which script to run, how long to delay for throttling, or
whether to log a message when sampling; this not only makes these tasks
independent of each other, but makes the actual thread run
deterministic.

Author: Marina Polyakova
Reviewed-by: Fabien Coelho
Discussion: https://postgr.es/m/72a0d590d6ba06f242d75c2e641820ec@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/409231919443984635b7ae9b7e2e261ab984eb1e

Modified Files
--------------
src/bin/pgbench/pgbench.c | 106 ++++++++++++++++++++++++++++++++--------------
1 file changed, 74 insertions(+), 32 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2018-11-16 19:54:03 Re: pgsql: Redesign initialization of partition routing structures
Previous Message Tom Lane 2018-11-16 19:16:16 Re: pgsql: Redesign initialization of partition routing structures