pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: gavin.panella@canonical.com
To: pgsql-bugs@postgresql.org
Subject: BUG #11919: Serializable isolation issue: one session seeing writes from another session.
Date: Sat, 08 Nov 2014 23:42:36 +0000
Message-ID: <20141108234236.2524.67434@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

The following bug has been logged on the website:

Bug reference:      11919
Logged by:          Gavin Panella
Email address:      gavin.panella@canonical.com
PostgreSQL version: 9.3.5
Operating system:   Ubuntu 12.04
Description:        

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.

Of course, my understanding may be the bug, but here's how to reproduce
the effect:

1. Open two psql sessions to the same database.

2. Create an example table:

     create table things (a int unique);

3. In the first session:

     begin isolation level serializable;
     insert into things (a) values (1);

   Don't commit yet.

4. In the second session:

     begin isolation level serializable;
     savepoint one;
     insert into things (a) values (1);

   This should hang.

5. In the first session:

     commit;

6. Go back to the second session. It will have failed with:

     ERROR:  duplicate key value violates unique constraint "things_a_key"
     DETAIL:  Key (a)=(1) already exists.

7. Continue in the second session:

     rollback to savepoint one;
     select * from things;

   You should see:

      a
     ---
     (0 rows)



-- 
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)  latest in thread

Message-ID: <20141108234236.2524.67434@wrigleys.postgresql.org>
Permalink:  ../20141108234236.2524.67434@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20141108234236.2524.67434@wrigleys.postgresql.org

 · 

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: gavin.panella@canonical.com
  Subject: Re: BUG #11919: Serializable isolation issue: one session seeing writes from another session.
  In-Reply-To: <20141108234236.2524.67434@wrigleys.postgresql.org>
  References: <20141108234236.2524.67434@wrigleys.postgresql.org>

* 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