BUG #11919: Serializable isolation issue: one session seeing writes from another session.

From: gavin(dot)panella(at)canonical(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #11919: Serializable isolation issue: one session seeing writes from another session.
Date: 2014-11-08 23:42:36
Message-ID: 20141108234236.2524.67434@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 11919
Logged by: Gavin Panella
Email address: gavin(dot)panella(at)canonical(dot)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)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message gopigarg729 2014-11-10 06:31:56 BUG #11926: warning
Previous Message nisam76 2014-11-08 13:16:13 BUG #11910: Database connection exhaustion