Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dW0sU-00066E-Gw for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jul 2017 13:43:30 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dW0sT-000329-F7 for pgsql-hackers@arkaria.postgresql.org; Fri, 14 Jul 2017 13:43:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dW0qw-0000Lb-Qd for pgsql-hackers@postgresql.org; Fri, 14 Jul 2017 13:41:54 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dW0qt-0001aV-B2 for pgsql-hackers@postgresql.org; Fri, 14 Jul 2017 13:41:54 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 7925A21C0659; Fri, 14 Jul 2017 16:41:50 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at postgrespro.ru MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1500039710; bh=88MGWOjMyuKOiIQPh8pjrqQ4i45jgyXkeiYK4FYaUhA=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=PcTkIgX3P/wyGdb/g9387CTpOL6rDthAIs9Al6ONC0QEoArm5ZX5zbGsJ2fj4l/4z mk07KVXoW7l3CoZRwT0SHUC/RqccsfWNAGers4QcqnxxahgQLoEhjHvxh7TJ4TEyTD 2/IL2i4toxIhtTbCveL6q0e/4ZW+A38qyMWiL30o= Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 14 Jul 2017 16:41:49 +0300 From: Marina Polyakova To: Fabien COELHO Cc: PostgreSQL Developers , Kevin Grittner , Andres Freund , Alvaro Herrera , Thomas Munro , Robert Haas Subject: Re: WIP Patch: Pgbench Serialization and deadlock errors Organization: Postgres Professional In-Reply-To: References: <72a0d590d6ba06f242d75c2e641820ec@postgrespro.ru> <6b4a7fb36c9956595a89a08e5368a9c5@postgrespro.ru> <01df6ca86c78e2c80b4e4d021c99d53a@postgrespro.ru> <6ce8613f061001105654673506348c13@postgrespro.ru> Message-ID: <0e7afb8c40e9241510947332be8e2ed2@postgrespro.ru> X-Sender: m.polyakova@postgrespro.ru User-Agent: Roundcube Webmail/1.2.4 List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org >>> 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers