Re: Serializable Isolation without blocking

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <robertmhaas(at)gmail(dot)com>,<laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: <nicolas(dot)barbier(at)gmail(dot)com>,<gsstark(at)mit(dot)edu>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Serializable Isolation without blocking
Date: 2010-01-01 20:12:54
Message-ID: 4B3E02E6020000250002DC40@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Albe Laurenz" wrote:

> If I remember right, one necessity for the SIREAD lock technique
> was that SIREAD locks taken by a transaction have to be kept after
> the transaction has ended.

Correct. An SIREAD lock must be held until completion of the last
serializable transaction holding a snapshot earlier than the lock
transaction's commit.

Exceptions to that are:

- If a serializable transaction is rolled back, all SIREAD locks can
be immediately released.

- If an an ACCESS EXCLUSIVE lock is acquired on the exact same object
already locked by an SIREAD lock, the SIREAD lock can be released.
(This is an optimization, not a requirement for correctness.)

> Won't that require fundamental changes?

We already have two different lock methods, one of which already
keeps locks past the end of a database transaction. USER locks
persist until the session terminates or the lock is explicitly
released. Given that, I don't think it would be fair to characterize
a third lock method with a third lifespan as a fundamental change --
just another implementation detail.

-Kevin

Browse pgsql-hackers by date

  From Date Subject
Next Message Kris Jurka 2010-01-01 20:31:58 Re: Cancelling idle in transaction state
Previous Message Magnus Hagander 2010-01-01 19:55:42 Re: win32 socket definition