Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xo1UC-0007r5-Ac for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Nov 2014 02:47:16 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Xo1UB-0001Lz-CG for pgsql-bugs@arkaria.postgresql.org; Tue, 11 Nov 2014 02:47:15 +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 1Xo1UA-0001Lt-Kz for pgsql-bugs@postgresql.org; Tue, 11 Nov 2014 02:47:14 +0000 Received: from [162.253.133.43] (helo=mwork.nabble.com) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Xo1U7-0003N3-6e for pgsql-bugs@postgresql.org; Tue, 11 Nov 2014 02:47:12 +0000 Received: from msam.nabble.com (unknown [162.253.133.85]) by mwork.nabble.com (Postfix) with ESMTP id 9ED4F9901CB for ; Mon, 10 Nov 2014 18:47:10 -0800 (PST) Date: Mon, 10 Nov 2014 19:47:10 -0700 (MST) From: David G Johnston To: pgsql-bugs@postgresql.org Message-ID: <1415674030081-5826447.post@n5.nabble.com> In-Reply-To: <1415670938.45502.YahooMailNeo@web122304.mail.ne1.yahoo.com> References: <20141108234236.2524.67434@wrigleys.postgresql.org> <1415670938.45502.YahooMailNeo@web122304.mail.ne1.yahoo.com> Subject: Re: BUG #11919: Serializable isolation issue: one session seeing writes from another session. MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 162.253.133.43 (failed) X-Pg-Spam-Score: 0.5 (/) 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 Kevin Grittner-5 wrote > " > gavin.panella@ > " < > gavin.panella@ > > wrote: > >> I think I might have found a bug in PostgreSQL 9.3.5 relating to >> serializable isolation, where code running within a savepoint can see >> data committed in a second session after the commencement of the first, >> but that data then "disappears" when the savepoint is rolled-back. > > Interesting. I see your point, yet I'm not sure what other > behavior we could reasonably provide. Once the snapshot is set for > the transaction, we can't use a different one which will show more > recent activity, so that SELECT at the end *has* to return what it > does. That leaves the question of whether the enforcement of the > unique constraint within the savepoint should behave differently. > Of course, you can make it do so by declaring it to be DEFERRED. > There are several other weird things that can happen when they > aren't deferred, for example: Per the documentation (and, yes, it is not a protocol describing quote): "This level emulates serial transaction execution for all committed transactions; as if transactions had been executed one after another, serially, rather than concurrently." The concept of ROLLBACK TO SAVEPOINT seems like it would be undefined in a serializable isolation level - in normal use unless the transaction is self-flagellating concurrency errors causing rollbacks cannot occur. If they do rollback should not be possible but a serializing error should simply occur and force you to retry your transaction in its entirety. Though I guess you could also interpret this as the second transaction was serially executed temporally first and so while the INSERT in that make-believe scenario would have succeeded the rollback is still a valid command which then undoes that insert so that when you get to the SELECT statement the things table is empty. I don't know if the above violates the rules but I thought that while it enforces some serial order the specific order is not necessarily in commit order... David J. -- View this message in context: http://postgresql.nabble.com/BUG-11919-Serializable-isolation-issue-one-session-seeing-writes-from-another-session-tp5826436p5826447.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs