postgresql/src
Tom Lane 7db285afc9 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:00 -05:00
..
backend Fix stale-pointer problem in fast-path locking logic. 2013-11-27 18:10:00 -05:00
bin Add --xlogdir option to pg_basebackup, for specifying the pg_xlog directory. 2013-11-27 14:00:16 +09:00
common Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
include Fix stale-pointer problem in fast-path locking logic. 2013-11-27 18:10:00 -05:00
interfaces ECPG: Fix searching for quoted cursor names case-sensitively. 2013-11-27 11:02:13 +01:00
makefiles Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
pl Fix plpython3 expected output. 2013-11-27 14:25:13 +02:00
port Ensure _dosmaperr() actually sets errno correctly. 2013-11-23 18:24:26 -05:00
template Remove leftovers of IRIX port 2013-11-12 06:39:36 -05:00
test Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
timezone Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
tools Fix whitespace 2013-11-13 21:25:52 -05:00
tutorial Modernize string literal syntax in tutorial example. 2013-01-19 17:20:32 -05:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:04 +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 Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
Makefile.global.in Switch dependency order of libpgcommon and libpgport 2013-10-17 22:02:35 -04:00
Makefile.shlib Remove IRIX port. 2013-10-18 08:14:21 -04:00
bcc32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
nls-global.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
win32.mak Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00