Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLoYt-000072-RB for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jun 2017 10:33:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dLoYt-0000zy-E9 for pgsql-hackers@arkaria.postgresql.org; Fri, 16 Jun 2017 10:33:07 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dLoXK-00050m-VZ for pgsql-hackers@postgresql.org; Fri, 16 Jun 2017 10:31:31 +0000 Received: from mail.postgrespro.ru ([93.174.131.138]) by makus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dLoXI-0006jH-Ch for pgsql-hackers@postgresql.org; Fri, 16 Jun 2017 10:31:29 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.postgrespro.ru (Postfix) with ESMTP id 69D6121C1FE2; Fri, 16 Jun 2017 13:31:27 +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=1497609087; bh=W0cOn6CqGQ6lb3R9Ja4uH907HHMGzCUSAEfATYHFOBc=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=mJA4QBXP0hEZJfN5EWCSHhWxr2o/2t3AoA8/fKJBtqqcSKT93TGNGHoApNcs8S0tB 5a7PcL0RaB4WLERwmv9t5L5smQJWB3oOp6uWv7CII62wTeVRUa+RPdO/sE5YlHN2IA /OgMB6/PMbm28NvTgpiUB2g8jJOKp15QWjGMoi0E= Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Date: Fri, 16 Jun 2017 13:31:27 +0300 From: Marina Polyakova To: Kevin Grittner , Andres Freund Cc: pgsql-hackers@postgresql.org, Alvaro Herrera , Thomas Munro Subject: Re: WIP Patch: Pgbench Serialization and deadlock errors Organization: Postgres Professional In-Reply-To: References: <72a0d590d6ba06f242d75c2e641820ec@postgrespro.ru> <20170615191636.mqzk7ongddmhoqzm@alap3.anarazel.de> Message-ID: 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 >>> 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...)? >> >> I can't quite parse that sentence, could you restate? > > The way I read it was that the most interesting solution would retry > a transaction from the beginning on a serialization failure or > deadlock failure. Most people who use serializable transactions (at > least in my experience) run though a framework that does that > automatically, regardless of what client code initiated the > transaction. These retries are generally hidden from the client > code -- it just looks like the transaction took a bit longer. > Sometimes people will have a limit on the number of retries. I > never used such a limit and never had a problem, because our > implementation of serializable transactions will not throw a > serialization failure error until one of the transactions involved > in causing it has successfully committed -- meaning that the retry > can only hit this again on a *new* set of transactions. > > Essentially, the transaction should only count toward the TPS rate > when it eventually completes without a serialization failure. > > Marina, did I understand you correctly? Álvaro Herrera in next message of this thread has understood my text right: > As far as I understand her proposal, it is exactly the opposite -- if a > transaction fails, it is discarded. And this P.S. note is asking > whether this is a good idea, or would we prefer that failing > transactions are retried. And thank you very much for your explanation how and why transactions with failures should be retried! I'll try to implement all of it. -- 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