WIP Patch: Pgbench Serialization and deadlock errors

From: Marina Polyakova <m(dot)polyakova(at)postgrespro(dot)ru>
To: pgsql-hackers(at)postgresql(dot)org
Subject: WIP Patch: Pgbench Serialization and deadlock errors
Date: 2017-06-14 08:48:25
Message-ID: 72a0d590d6ba06f242d75c2e641820ec@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, hackers!

Now in pgbench we can test only transactions with Read Committed
isolation level because client sessions are disconnected forever on
serialization failures. There were some proposals and discussions about
it (see message here [1] and thread here [2]).

I suggest a patch where pgbench client sessions are not disconnected
because of serialization or deadlock failures and these failures are
mentioned in reports. In details:
- transaction with one of these failures continue run normally, but its
result is rolled back;
- if there were these failures during script execution this
"transaction" is marked
appropriately in logs;
- numbers of "transactions" with these failures are printed in progress,
in aggregation logs and in the end with other results (all and for each
script);

Advanced options:
- mostly for testing built-in scripts: you can set the default
transaction isolation level by the appropriate benchmarking option (-I);
- for more detailed reports: to know per-statement serialization and
deadlock failures you can use the appropriate benchmarking option
(--report-failures).

Also: TAP tests for new functionality and changed documentation with new
examples.

Patches are attached. Any suggestions are welcome!

P.S. Does this use case (do not retry transaction with serialization or
deadlock failure) is most interesting or failed transactions should be
retried (and how much times if there seems to be no hope of success...)?

[1]
https://www.postgresql.org/message-id/4EC65830020000250004323F%40gw.wicourts.gov
[2]
https://www.postgresql.org/message-id/flat/alpine(dot)DEB(dot)2(dot)02(dot)1305182259550(dot)1473%40localhost6(dot)localdomain6#alpine(dot)DEB(dot)2(dot)02(dot)1305182259550(dot)1473(at)localhost6(dot)localdomain6

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

Attachment Content-Type Size
v1-0001-Pgbench-Serialization-and-deadlock-errors.patch text/x-diff 19.5 KB
v1-0002-Pgbench-Set-default-transaction-isolation-level.patch text/x-diff 8.5 KB
v1-0003-Pgbench-Report-per-statement-serialization-and-de.patch text/x-diff 6.3 KB
v1-0004-Pgbench-Fix-documentation.patch text/x-diff 15.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Aleksander Alekseev 2017-06-14 09:04:26 Re: WIP: Data at rest encryption
Previous Message Masahiko Sawada 2017-06-14 06:54:08 RemoveSubscriptionRel uses simple_heap_delete