Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Y5da6-00060k-G5 for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Dec 2014 16:54:10 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Y5da5-0003pD-CU for pgsql-hackers@arkaria.postgresql.org; Mon, 29 Dec 2014 16:54:09 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Y5dZw-0003bR-OX for pgsql-hackers@postgresql.org; Mon, 29 Dec 2014 16:54:01 +0000 Received: from nm26-vm5.bullet.mail.ne1.yahoo.com ([98.138.91.248]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1Y5dZs-0001xn-FY for pgsql-hackers@postgresql.org; Mon, 29 Dec 2014 16:53:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1419872035; bh=5v99S0wtkMupgTMZSdwPPWR+gbklJTm2jy0fln4JeR8=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=A4TTnbWYCLsyaVHN8V1JKYgI/Hin603J/DA4g0Nte4YaGYRLI7s33f/BnXcWJYS5lEPWFpkJKTTlOtycwv57FDMUm3YY6B5C8ukClYpjg+rjKeayPLu+r2J3NOYtvLxhPnt1x5vKgjkLMAXpEoUG3bDSXBCT/ANT4qdv6laGCDNX+PGapxqmBJx344bjsS5Gm99aNtwLpvEUqsFF5KvYkNqk4OM+ameVQ8UTtNUKdOElu6/dchqw1Mu/1ILE7EvkVmb3hyjmXZKwb1G5b12DFgcWALdeQgaBJMVdhGBW153WkJKmOU2bYqB3goDEjIcnMQiKAdPMD6Dl5vttwVKEyw== DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s2048; d=ymail.com; b=DmTQTGefgEcg8zIE+CEPt/WCy59rA6o1BihtEY15TLfGU19Pwup127zu5kf2KKnYTzmwqcXkAO+6LB+jz8NySmdhoKOziy1oWLHkIdDVZpS2U3SVMbFZop2WGnbNRdKzMjXVYmRrlZJoDPhT0eOsU/Q3FzIjOUOBNVPKDnEmby3b8zfemOA9z7V95ov0b53IC2AxOG+sGoP5dDOHHz8MVNSkTS/pyieJfCvnM9iCOOHiHN2GLZd9xid5m3CvT3ysHJgxw1Oe8CLNvrWr6HmPgVdMjVnLIajc5POSOKtz2LtxMwcH5wGPDVxjBkgITZbl6vFaOift3TrMm2c5fUZJMg==; Received: from [98.138.100.111] by nm26.bullet.mail.ne1.yahoo.com with NNFMP; 29 Dec 2014 16:53:55 -0000 Received: from [98.138.88.236] by tm100.bullet.mail.ne1.yahoo.com with NNFMP; 29 Dec 2014 16:53:55 -0000 Received: from [127.0.0.1] by omp1036.mail.ne1.yahoo.com with NNFMP; 29 Dec 2014 16:53:55 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 400373.33842.bm@omp1036.mail.ne1.yahoo.com X-YMail-OSG: TMJy0V8VM1kPaugCKnnTdy8RMCqiG1xIvY2UCPe11listP.rXiblyYbX8wd5.JA MBVFfj8_xSfeRDFeON3Z7F8vEGsIG4D7MPSQAz6E4xq47XO7WvynsVuw1lGkpJNpDuUEKsSCp.w. Ela5SVFxbgr6u6w8Y7xiTz.h2SoGKrZH1dpkLYcG7UfQSElif5W2XbvcayaF._pxGAIAd2zOA5FB iuqiUGHV.tgs0IhuMjpj7x5_yyykjVINV72H9gKg6Nayf9XIBWJyNsVpUPm95Dgm4PlmVegcRobM Wp0yXfH6f.hTwJR.T39rx1m1h5q8z7rhIHa85n_nCWivSupkkLAJHLb1TDBZQap354sXeFTuwyoW yRPunRxSN0EaXQqHNr919gpI9VaoMOlmsTT1LfEVEv4oqirxt5KymEcwWnr8B7x2TZy8c.1Js150 KBhHQkv2PuErcvmirFp0lGR.en1DdTVm9FlBadqGlVX33zzoXGTQlSGsUkE5uBD1l6BA4Ufb9GCk gKJjoyacrFJfyQwobFmmjOjieRMdeHlooQM4_E3ZtkZ_D9xHPSI2qk8PfpnQEqQ-- Received: by 98.138.105.216; Mon, 29 Dec 2014 16:53:54 +0000 Date: Mon, 29 Dec 2014 16:53:24 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: Merlin Moncure , Greg Stark Cc: Tom Lane , Josh Berkus , "nikita.y.volkov@mail.ru" , "pgsql-hackers@postgresql.org" Message-ID: <1511100927.1386218.1419872004754.JavaMail.yahoo@jws100113.mail.ne1.yahoo.com> In-Reply-To: References: Subject: Re: BUG #12330: ACID is broken for unique constraints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 1757 X-Pg-Spam-Score: -2.1 (--) 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 Merlin Moncure wrote: > Serialization errors only exist as a concession to concurrency > and performance. Again, they should be returned as sparsely as > possible because they provide absolutely (as Tom pointed > out) zero detail to the application. That is false. They provide an *extremely* valuable piece of information which is not currently available when you get a duplicate key error -- whether the error occurred because of a race condition and will not fail for the same cause if retried. > The precise definition of the error is up to us, but I'd rather > keep it to it's current rather specific semantics. The semantics are so imprecise that Tom argued that we should document that transactions should be retried from the start when you get the duplicate key error, since it *might* have been caused by a race condition. I'm curious how heavily you use serializable transactions, because I have trouble believing that those who rely on them as their primary (or only) strategy for dealing with race conditions under high concurrency would take that position. As for the fact that RI violations also don't return a serialization failure when caused by a race with concurrent transactions, I view that as another weakness in PostgreSQL. I don't think there is a problem curing one without curing the other at the same time. I have known of people writing their own triggers to enforce RI rather than defining FKs precisely so that they can get a serialization failure return code and do automatic retry if it is caused by a race condition. That's less practical to compensate for when it comes to unique indexes or constraints. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers