Re: Serializable Snapshot Isolation

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: drkp(at)csail(dot)mit(dot)edu, heikki(dot)linnakangas(at)enterprisedb(dot)com, pgsql-hackers(at)postgresql(dot)org, tgl(at)sss(dot)pgh(dot)pa(dot)us
Subject: Re: Serializable Snapshot Isolation
Date: 2010-09-25 16:13:29
Message-ID: AANLkTimv=90KrnreD3ki+=HanXeU_eDeruKTitwDK_BS@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sat, Sep 25, 2010 at 4:24 PM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> OK, to get back to the question -- pg_dump's transaction (T0) could
> see an inconsistent version of the database if one transaction (TN)
> writes to a table, another transaction (T1) overlaps TN and can't
> read something written by TN because they are concurrent, TN commits
> before T0 acquires its snapshot, T1 writes to a table, T0 starts
> before T1 commits, and T0 can't read something which T1 wrote (which
> is sort of a given for a database dump and overlapping transactions).

Can I collapse this into a single list of events (apologies, this
isn't going to line up, I'm writing it in a proportional font :( )

TN starts
T1 starts
TN writes
T1 reads
TN commits
T0 starts (pg_dump)
T1 writes
T0 reads (pg_dump)
T1 commits

So T1 must have happened before TN because it wrote something based on
data as it was before TN modified it. But T0 can see TN but not T1 so
there's no complete ordering between the three transactions that makes
them all make sense.

The thing is that the database state is reasonable, the database state
is after it would be if the ordering were T1,TN with T0 happening any
time. And the backup state is reasonable, it's as if it occurred after
TN and before T1. They just don't agree.

--
greg

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2010-09-25 16:43:31 Stalled post to pgsql-committers
Previous Message Esteban Zimanyi 2010-09-25 15:56:29 Help with User-defined function in PostgreSQL with Visual C++