Re: BUG #13524: Not Getting expected Serialization error

From: Bobby Rullo <bobby(dot)rullo(at)coreos(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #13524: Not Getting expected Serialization error
Date: 2015-07-29 16:50:28
Message-ID: CANFpDAD5Bgr9=MYqdrHnMnp9s5DFPPKO4kdMAwxZqOqQRTEe4A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

That took me a while to wrap my head around but it makes sense now. Thanks
for the succinct explanation!

Bobby

On Wed, Jul 29, 2015 at 8:40 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> bobby(dot)rullo(at)coreos(dot)com writes:
> > To reproduce:
> > 1) execute statements in sequence 1 on a connection, stopping at the
> > "--EXECUTE" statement.
> > 2) In another connection, execute all the statements in Sequence 2.
> > 3) Back in the first connection execute the remaining statement (the
> > "commit;")
>
> > Expected:
> > error when trying to commit, eg. "ERROR: could not serialize"
>
> > Actual:
> > Both commits succeed.
>
> > Interesting tidbit:
> > If you do the exact steps as above but uncomment the "select count(*)" in
> > sequence 2, you get the expected error.
>
> This seems perfectly fine to me. Without the "select count(*)" in
> transaction 2, there is a valid serialization of the transactions,
> ie t1 before t2. Serializability is *not* defined as "the transactions
> appear to have executed in the order they were started (or committed)".
> It is defined as "there is some consistent order in which they appear
> to have executed".
>
> regards, tom lane
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2015-07-29 16:59:55 Re: BUG #13525: Database crashed with several error messages "Could not open file "pg_multixact/members/"
Previous Message Tom Lane 2015-07-29 16:24:31 Re: BUG #13526: Out of memory when parallelised