Re: BUG #13667: SSI violation...

From: Kevin Grittner <kgrittn(at)ymail(dot)com>
To: "sean(at)chittenden(dot)org" <sean(at)chittenden(dot)org>, "pgsql-bugs(at)postgresql(dot)org" <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13667: SSI violation...
Date: 2015-10-09 21:48:56
Message-ID: 1810271785.1293615.1444427336478.JavaMail.yahoo@mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thursday, October 8, 2015 5:01 AM, "sean(at)chittenden(dot)org" <sean(at)chittenden(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message jkoceniak 2015-10-09 23:46:54 BUG #13672: What is the purpose of the temp_buffers setting?
Previous Message Haribabu Kommi 2015-10-09 20:35:27 Re: BUG #13670: DST discrepancy between age() and subtraction for timestamptz arguments