pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11919: Serializable isolation issue: one session seeing writes from another session.
Date: Mon, 10 Nov 2014 19:47:10 -0700 (MST)
Message-ID: <1415674030081-5826447.post@n5.nabble.com> (raw)
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>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Kevin Grittner-5 wrote
> "

> gavin.panella@

> " &lt;

> gavin.panella@

> &gt; 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-a...
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



view thread (3+ messages)

Message-ID: <1415674030081-5826447.post@n5.nabble.com>
Permalink:  ../1415674030081-5826447.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1415674030081-5826447.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: BUG #11919: Serializable isolation issue: one session seeing writes from another session.
  In-Reply-To: <1415674030081-5826447.post@n5.nabble.com>
  References: <20141108234236.2524.67434@wrigleys.postgresql.org> <1415670938.45502.YahooMailNeo@web122304.mail.ne1.yahoo.com> <1415674030081-5826447.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox