Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors

From: Marina Polyakova <m(dot)polyakova(at)postgrespro(dot)ru>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: pgsql-hackers(at)postgresql(dot)org, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Ildus Kurbangaliev <i(dot)kurbangaliev(at)postgrespro(dot)ru>, Teodor Sigaev <teodor(at)sigaev(dot)ru>
Subject: Re: [HACKERS] WIP Patch: Pgbench Serialization and deadlock errors
Date: 2018-08-08 08:02:01
Message-ID: 58a619e0ba711cda355d152241430d4f@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 07-08-2018 19:21, Fabien COELHO wrote:
> Hello Marina,

Hello, Fabien!

>> v10-0001-Pgbench-errors-use-the-RandomState-structure-for.patch
>> - a patch for the RandomState structure (this is used to reset a
>> client's random seed during the repeating of transactions after
>> serialization/deadlock failures).
>
> About this v10 part 1:
>
> Patch applies cleanly, compile, global & local make check both ok.
>
> The random state is cleanly separated so that it will be easy to reset
> it on client error handling ISTM that the pgbench side is
> deterministic with
> the separation of the seeds for different uses.
>
> Code is clean, comments are clear.

:-)

> I'm wondering what is the rational for the "xseed" field name? In
> particular, what does the "x" stands for?

I called it "...seed" instead of "data" because perhaps the "data" is
too general a name for use here (but I'm not entirely sure what Alvaro
Herrera meant in [1], see my answer in [2]). I called it "xseed" to
combine it with the arguments of the functions _dorand48 / pg_erand48 /
pg_jrand48 in the file erand48.c. IIUC they use a linear congruential
generator and perhaps "xseed" means the sequence with the name X of
pseudorandom values of size 48 bits (X_0, X_1, ... X_n) where X_0 is the
seed / the start value.

[1]
https://www.postgresql.org/message-id/20180711180417.3ytmmwmonsr5lra7@alvherre.pgsql

> LGTM, though I'd rename the random_state struct members so that it
> wouldn't look as confusing. Maybe that's just me.

[2]
https://www.postgresql.org/message-id/cb2cde10e4e7a10a38b48e9cae8fbd28%40postgrespro.ru

--
Marina Polyakova
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro HORIGUCHI 2018-08-08 08:30:50 Re: Problem while updating a foreign table pointing to a partitioned table on foreign server
Previous Message Noah Misch 2018-08-08 07:07:20 Re: Facility for detecting insecure object naming