lock_timeout GUC patch - Mailing list pgsql-hackers

From Boszormenyi Zoltan
Subject lock_timeout GUC patch
Date
Msg-id 4B4B99B5.70709@cybertec.at
Whole thread Raw
In response to Re: SELECT ... FOR UPDATE [WAIT integer | NOWAIT] for 8.5  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: lock_timeout GUC patch
List pgsql-hackers
Hi,

and I am happy to present the newest patch. Current state is
that it doesn't segfault and seems to work as expected.
These combinations below were tested.

The lock type on the left side of the arrow is taked by transaction 1
then transaction 2 tries to take the lock on the right side of the arrow.

LOCK TABLE -> LOCK TABLE = xact 2 times out
LOCK TABLE -> SELECT FOR UPDATE = xact 2 times out
LOCK TABLE -> SELECT FOR SHARE = xact 2 times out
LOCK TABLE -> SELECT (no lock) = xact 2 times out

SELECT FOR UPDATE -> LOCK TABLE = xact 2 times out
SELECT FOR UPDATE -> SELECT FOR UPDATE = xact 2 times out
SELECT FOR UPDATE -> SELECT FOR SHARE = xact 2 times out
SELECT FOR UPDATE -> SELECT (no lock) = xact 2 returns record

SELECT FOR SHARE -> LOCK TABLE = xact 2 times out
SELECT FOR SHARE -> SELECT FOR UPDATE = xact 2 times out
SELECT FOR SHARE -> SELECT FOR SHARE = xact 2 returns record
   (+ UPDATE on xact 1 times out)
SELECT FOR SHARE -> SELECT (no lock) = xact 2 returns record

SELECT (no lock) -> LOCK TABLE = xact 2 times out
SELECT (no lock) -> SELECT FOR UPDATE = xact 2 returns record
SELECT (no lock) -> SELECT FOR SHARE = xact 2 returns record
SELECT (no lock) -> SELECT (no lock) = xact 2 returns record

Comments?

Best regards,
Zoltán Böszörményi

--
Bible has answers for everything. Proof:
"But let your communication be, Yea, yea; Nay, nay: for whatsoever is more
than these cometh of evil." (Matthew 5:37) - basics of digital technology.
"May your kingdom come" - superficial description of plate tectonics

----------------------------------
Zoltán Böszörményi
Cybertec Schönig & Schönig GmbH
http://www.postgresql.at/


Attachment

pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: Testing with concurrent sessions
Next
From: Matteo Beccati
Date:
Subject: Re: mailing list archiver chewing patches