Re: Serializable Isolation without blocking - Mailing list pgsql-hackers

From Albe Laurenz
Subject Re: Serializable Isolation without blocking
Date
Msg-id D960CB61B694CF459DCFB4B0128514C202FF65B0@exadv11.host.magwien.gv.at
Whole thread Raw
In response to Re: Serializable Isolation without blocking  (Gregory Stark <stark@enterprisedb.com>)
List pgsql-hackers
Greg Stark wrote:
> > So I think one would have to add intention locks for rows considered
> > in the WHERE clause to guarantee true serializability.
>
> Does the paper explain how to deal with rows "considered" in the WHERE clause
> which don't yet exist? Ie, "SELECT count(*) WHERE foo" needs to take out a
> lock which would cause any transaction which inserts a new record where foo is
> true to be abort.

Quote:
"To prevent phantoms in a system with row-level locking and versioning,
the algorithm described here would need to be extended to take SIREAD locks
on larger granules analogously to multigranularity intention locks in
traditional two-phase locking systems."

[...]

"We have not pursued the details in this paper because the phantom
issue does not arise in our prototype implementation, since Oracle
Berkeley DB does all locking and versioning at page granularity."

End quote.

> Are these intention locks predicate locks, in that they're not associated with
> actual pages or records but with potential records which might be inserted in
> the future?

No, they are associated with the page that contains the actual record.

I think that's also meant with the "larger granules" in the above quote:
Take an intention lock on every page which might affect the condition.

Yours,
Laurenz Albe


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [BUGS] BUG #4796: Recovery followed by backup creates unrecoverable WAL-file
Next
From: Tom Lane
Date:
Subject: Re: Extra cost of "lossy mode" Bitmap Scan plan