From:
Peter Eisentraut <peter_e(at)gmx(dot)net>
To:
pgsql-hackers(at)postgresql(dot)org
Cc:
"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>,
"Greg Stark" <greg(dot)stark(at)enterprisedb(dot)com>,
"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject:
Re: incoherent view of serializable transactions
Date:
2009-01-03 22:20:10
Message-ID:
200901040020.11302.peter_e@gmx.net (view raw or flat )
Thread:
2008-12-22 17:00:53 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-22 17:54:59 from Martijn van Oosterhout <kleptog(at)svana(dot)org>
2008-12-22 18:37:45 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 04:44:17 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2008-12-23 14:51:03 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 14:59:30 from Emmanuel Cecchet <manu(at)frogthinker(dot)org>
2008-12-23 15:14:36 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 15:47:37 from Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
2008-12-23 16:10:05 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 20:55:47 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2008-12-23 21:11:00 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-31 00:33:26 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2009-01-03 22:06:14 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2009-01-03 22:53:51 from Gregory Stark <stark(at)enterprisedb(dot)com>
2009-01-03 23:37:09 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2009-01-05 14:51:29 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2009-01-07 13:17:49 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2009-01-07 15:40:02 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2009-01-08 14:45:25 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2009-01-22 03:00:16 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 16:12:09 from Gregory Stark <stark(at)enterprisedb(dot)com>
2008-12-23 16:27:57 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 17:04:11 from Gregory Stark <stark(at)enterprisedb(dot)com>
2008-12-23 17:24:51 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 17:15:38 from Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
2008-12-23 17:58:29 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-23 20:46:39 from "Robert Haas" <robertmhaas(at)gmail(dot)com>
2008-12-23 21:06:01 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-24 23:46:17 from Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
2008-12-24 23:53:35 from Robert Haas <robertmhaas(at)gmail(dot)com>
2008-12-29 12:20:34 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2008-12-29 15:16:42 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-29 15:27:51 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2008-12-29 17:21:12 from Greg Stark <greg(dot)stark(at)enterprisedb(dot)com>
2008-12-30 08:56:43 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2008-12-30 17:28:01 from "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
2009-01-03 22:20:10 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2008-12-23 05:42:06 from Emmanuel Cecchet <manu(at)frogthinker(dot)org>
2008-12-23 18:48:52 from Jeff Davis <pgsql(at)j-davis(dot)com>
2008-12-23 23:44:53 from Emmanuel Cecchet <manu(at)frogthinker(dot)org>
Lists:
pgsql-hackers
On Tuesday 30 December 2008 19:28:01 Kevin Grittner wrote:
> Here we go. I've labeled the transactions consistently with new
> thread I started trying to characterize the full scope of issues and
> workarounds.
OK, I believe it now. :-)
The missing predicate locking is again at fault here. Because this ...
> -- connection 1 (start of T0)
> start transaction isolation level serializable;
> insert into receipt values (3, (select deposit_date from ctl where k =
> 'receipt'), 4.00);
... would lock ctl where k = 'receipt' ...
> -- connection 2 (T1)
> start transaction isolation level serializable;
> update ctl set deposit_date = date '2008-12-23' where k = 'receipt';
> commit transaction;
... and then this would have to wait ...
> -- connection 2 (TN version 2)
> start transaction isolation level serializable;
> insert into receipt_totals
> select r.deposit_date, c.deposit_date, sum(amount)
> from ctl c join receipt r
> on ( r.deposit_date < c.deposit_date
> and not exists
> (
> select * from receipt r2
> where r2.deposit_date < c.deposit_date
> and r2.deposit_date > r.deposit_date
> )
> )
> group by r.deposit_date, c.deposit_date;
> commit transaction;
... and this could never be executed before T0 commits.
In response to
pgsql-hackers by date
Next :From: Peter EisentrautDate: 2009-01-03 22:29:22
Subject : Re: Frames vs partitions: is SQL2008 completely insane?
Previous :From : Peter EisentrautDate : 2009-01-03 22:06:14
Subject : Re: incoherent view of serializable transactions