Re: 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: PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>, Kevin Grittner <kgrittn(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>
Subject: Re: WIP Patch: Pgbench Serialization and deadlock errors
Date: 2017-07-14 13:41:49
Message-ID: 0e7afb8c40e9241510947332be8e2ed2@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>>> Not necessarily? It depends on where the locks triggering the issue
>>> are set, if they are all set after the savepoint it could work on a
>>> second attempt.
>>
>> Don't you mean the deadlock failures where can really help rollback to
>
> Yes, I mean deadlock failures can rollback to a savepoint and work on
> a second attempt.
>
>> And could you, please, give an example where a rollback to savepoint
>> can help to end its subtransaction successfully after a serialization
>> failure?
>
> I do not know whether this is possible with about serialization
> failures.
> It might be if the stuff before and after the savepoint are somehow
> unrelated...

If you mean, for example, the updates of different tables - a rollback
to savepoint doesn't help.

And I'm not sure that we should do all the stuff for savepoints
rollbacks because:
- as I see it now it only makes sense for the deadlock failures;
- if there's a failure what savepoint we should rollback to and start
the execution again? Maybe to go to the last one, if it is not
successful go to the previous one etc.
Retrying the entire transaction may take less time..

>> [...] I mean that the sum of transactions with serialization failure
>> and transactions with deadlock failure can be greater then the totally
>> sum of transactions with failures.
>
> Hmmm. Ok.
>
> A "failure" is a transaction (in the sense of pgbench) that could not
> made it to the end, even after retries. If there is a rollback and the
> a retry which works, it is not a failure.
>
> Now deadlock or serialization errors, which trigger retries, are worth
> counting as well, although they are not "failures". So my format
> proposal was over optimistic, and the number of deadlocks and
> serializations should better be on a retry count line.
>
> Maybe something like:
> ...
> number of failures: 12 (0.004%)
> number of retries: 64 (deadlocks: 29, serialization: 35)

Ok! How to you like the idea to use the same format (the total number of
transactions with failures and the number of retries for each failure
type) in other places (log, aggregation log, progress) if the values are
not "default" (= no failures and no retries)?

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marina Polyakova 2017-07-14 13:48:29 Re: WIP Patch: Pgbench Serialization and deadlock errors
Previous Message Alik Khilazhev 2017-07-14 13:37:50 Re: [WIP] Zipfian distribution in pgbench