Re: [HACKERS] pgbench randomness initialization

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] pgbench randomness initialization
Date: 2018-01-02 09:48:24
Message-ID: alpine.DEB.2.20.1801021022420.20034@lancre
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


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.

Attachment Content-Type Size
pgbench-seed-2.patch text/x-diff 6.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Magnus Hagander 2018-01-02 10:01:57 Re: Add default role 'pg_access_server_files'
Previous Message Rushabh Lathia 2018-01-02 09:38:14 Re: [HACKERS] Parallel tuplesort (for parallel B-Tree index creation)