Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZkfXx-00032l-Sj for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Oct 2015 21:49:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZkfXx-0005ML-8k for pgsql-bugs@arkaria.postgresql.org; Fri, 09 Oct 2015 21:49:49 +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) (envelope-from ) id 1ZkfXJ-0004eR-SG for pgsql-bugs@postgresql.org; Fri, 09 Oct 2015 21:49:10 +0000 Received: from nm28-vm3.bullet.mail.gq1.yahoo.com ([98.136.216.162]) by makus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZkfXB-0002kO-FW for pgsql-bugs@postgresql.org; Fri, 09 Oct 2015 21:49:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1444427339; bh=NTqSTMaHo9ufWXTUOD5yfQRtLMf1WBa5jkrEYlkuhAg=; h=Date:From:Reply-To:To:In-Reply-To:References:Subject:From:Subject; b=oDR8nXH7867Mn/6fJK5cyBp+hZUpZoMVfH7aQXqmgkd7Cwy+daM6UP+aAG7OSNWGMlwM/9lCyJ+KhqZIEW6izANcNbyG03PLegGnb3NPuYMxqZIqoMovGAoghILnetftIE3zlAwBj65bvC24puUM2gLEHMgpkOgcsa9ZoZEmnOsNEajvsBP8VTqsmvFOCmnoByQHuFPXcRQg7+C0CXyByRkPmKXokh3rdCC14pMKlX27idJ7g9+DsKH0CpawDDweoMfOKwxpzKx7EX0kt+p3mDLgn5+X6BbTRTnUAQ6cpfkUR3hisANwJ5uTp+eLlsJjCzmlnptfeUY8WmwH70MrbQ== Received: from [98.137.12.63] by nm28.bullet.mail.gq1.yahoo.com with NNFMP; 09 Oct 2015 21:48:59 -0000 Received: from [98.137.12.231] by tm8.bullet.mail.gq1.yahoo.com with NNFMP; 09 Oct 2015 21:48:59 -0000 Received: from [127.0.0.1] by omp1039.mail.gq1.yahoo.com with NNFMP; 09 Oct 2015 21:48:59 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 889647.29914.bm@omp1039.mail.gq1.yahoo.com X-YMail-OSG: dg_1SJgVM1l9gVPEWcpptQwB_wPr4oj6sr_gqq.ExqzYHj73HMGKAm19wa_Wvpd oBSfk8QA.0ZsqIpmyhoSWaFaw405fcW0848Soks04qB2aMukJSMcyUPoDsTHfMp3cBDyFYhonzjj UlDxwdlj_RMKNg0x_TYFdlm_U4F9qjUpvBnoML0YQzWRkDtZ9KvrQa_iKEPBLeFJAqjZXNGP.A8p ZycLOXDny_gfqoVdW04y0XwD60TRQeNz9m.6YkFu9qF8W55kjLb.LNb3VMh3cUNEV_8tYIaXnqJN JMGeRdNfVNVXt3Es9l1O8IUaxBlQVWFjIij.qI23bwZwYsF4ByaEHGmDXugFJkqBIYN_A0gMEz9d Al9lsAQolRlNN9FEeNeK4IEPpt.O36ghFlfb016H7IuZ4FuZ65Y2cxhGv4slwhQv_OuzZaCjJP.e PNXB5sNSgvxgkBAPklqFkF3QpqPKyAhhQEeePPWtMPmtO.FIHK4.JqS6xRdpuVOxh Received: by 216.39.60.205; Fri, 09 Oct 2015 21:48:59 +0000 Date: Fri, 9 Oct 2015 21:48:56 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: "sean@chittenden.org" , "pgsql-bugs@postgresql.org" Message-ID: <1810271785.1293615.1444427336478.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <20151008100036.8427.63845@wrigleys.postgresql.org> References: <20151008100036.8427.63845@wrigleys.postgresql.org> Subject: Re: BUG #13667: SSI violation... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 1544 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Thursday, October 8, 2015 5:01 AM, "sean@chittenden.org" wrote: > A few weeks back I was pointed in the direction of a bug that appears to be > an SSI violation. The repro case below is written using bash and psql. > > In a tight loop, we would expect 50% of these transactions to fail. > Instead, periodically we're seeing both transaction commit successfully. > The concern is that PostgreSQL thinks these transactions are commutable or > the SIREAD lock isn't erected correctly. > > https://github.com/gfredericks/pg-serializability-bug > > The two concurrent transactions required to tickle this bug are: > > BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; > INSERT INTO things (id) VALUES ('A'); > SELECT id FROM things; > COMMIT; > > BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE; > INSERT INTO things (id) VALUES ('B'); > SELECT id FROM things; > COMMIT; I agree this is a bug, and it behave like a race condition with a very narrow window of time for the second process to hit. It has proven very hard to find the cause. So far every attempt to instrument the code to catch the bug in progress has distorted the timings enough to prevent the bug from showing. Next time I take a run at this I think I need to insert delays at suspicious points in the code to try to provoke it at greater volume. If anyone else wants to take a shot at that and show me what they found that does that, it would expedite getting a fix. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs