Re: [HACKERS] pgbench randomness initialization
Fabien COELHO <coelho@cri.ensmp.fr>
From: Fabien COELHO <coelho@cri.ensmp.fr>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Andres Freund <andres@anarazel.de>,
PostgreSQL Developers <pgsql-hackers@postgresql.org>
Date: 2018-01-02T09:48:24Z
Lists: pgsql-hackers
Attachments
- pgbench-seed-2.patch (text/x-diff) patch
Hello Alvaro, I revive this patch because controlling the seed is useful for tap testing pgbench. > The output should include the random seed used, whether it was passed > with --random-seed, environment variable or randomly determined. That > way, the user that later wants to verify why a particular run caused > some particular misbehavior knows what seed to use to reproduce that > run. Yep. Here is a new version which output use used seed when a seed is explicitely set with an option or from the environment. However, the default (current) behavior remains silent, so no visible changes unless tinkering with it. The patch also allows to use a "strong" random for seeding the PRNG, thanks to pg_strong_random(). The tests assume that stdlib random/srandom behavior is standard thus deterministic between platform. -- Fabien.
Commits
-
Set random seed for pgbench.
- 64f85894ad27 11.0 landed
-
Fix pgbench TAP test to work in VPATH builds.
- e94f2bc809a0 11.0 landed