postgresql/src
Tom Lane 024edb4543 Fix stale-pointer problem in fast-path locking logic.
When acquiring a lock in fast-path mode, we must reset the locallock
object's lock and proclock fields to NULL.  They are not necessarily that
way to start with, because the locallock could be left over from a failed
lock acquisition attempt earlier in the transaction.  Failure to do this
led to all sorts of interesting misbehaviors when LockRelease tried to
clean up no-longer-related lock and proclock objects in shared memory.
Per report from Dan Wood.

In passing, modify LockRelease to elog not just Assert if it doesn't find
lock and proclock objects for a formerly fast-path lock, matching the code
in FastPathGetRelationLockEntry and LockRefindAndRelease.  This isn't a
bug but it will help in diagnosing any future bugs in this area.

Also, modify FastPathTransferRelationLocks and FastPathGetRelationLockEntry
to break out of their loops over the fastpath array once they've found the
sole matching entry.  This was inconsistently done in some search loops
and not others.

Improve assorted related comments, too.

Back-patch to 9.2 where the fast-path mechanism was introduced.
2013-11-27 18:10:06 -05:00
..
backend Fix stale-pointer problem in fast-path locking logic. 2013-11-27 18:10:06 -05:00
bin Don't abort pg_basebackup when receiving empty WAL block 2013-11-11 14:34:06 +01:00
include Fix stale-pointer problem in fast-path locking logic. 2013-11-27 18:10:06 -05:00
interfaces ECPG: Fix searching for quoted cursor names case-sensitively. 2013-11-27 11:15:13 +01:00
makefiles Revert "Backpatch pgxs vpath build and installation fixes (v2)" 2013-10-07 22:37:26 -04:00
pl Translation updates 2013-10-07 16:17:51 -04:00
port Ensure _dosmaperr() actually sets errno correctly. 2013-11-23 18:24:46 -05:00
template Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
test Flatten join alias Vars before pulling up targetlist items from a subquery. 2013-11-22 14:37:29 -05:00
timezone Fix some odd behaviors when using a SQL-style simple GMT offset timezone. 2013-11-01 12:13:26 -04:00
tools Avoid renaming data directory during MSVC upgrade testing. 2013-03-23 16:31:01 -04:00
tutorial Modernize string literal syntax in tutorial example. 2013-01-19 17:20:56 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +02:00
bcc32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Fix some oversights in distprep and maintainer-clean targets. 2011-03-10 00:04:05 -05:00
Makefile.global.in Revert "Backpatch pgxs vpath build and installation fixes (v2)" 2013-10-07 22:37:26 -04:00
Makefile.shlib Remove BSD/OS (BSDi) port. There are no known users upgrading to 2012-05-03 10:58:44 -04:00
nls-global.mk Lots of doc corrections. 2012-04-23 22:43:09 -04:00
win32.mak Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00