lock_timeout GUC patch
Boszormenyi Zoltan <zb@cybertec.at>
From: Boszormenyi Zoltan <zb@cybertec.at>
To: pgsql-hackers@postgresql.org
Cc: Robert Haas <robertmhaas@gmail.com>, Jeff Janes <jeff.janes@gmail.com>, Alvaro Herrera <alvherre@commandprompt.com>, Bruce Momjian <bruce@momjian.us>, Hans-Juergen Schoenig <postgres@cybertec.at>, Josh Berkus <josh@agliodbs.com>, Tom Lane <tgl@sss.pgh.pa.us>, Sándor Miglécz <sandor@cybertec.at>, Andres Freund <andres@anarazel.de>
Date: 2010-01-11T21:35:49Z
Lists: pgsql-hackers
Attachments
- 5-pg85-locktimeout-11-ctxdiff.patch (text/x-patch) patch
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/