postgresql/src/backend
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
..
access Get rid of the post-recovery cleanup step of GIN page splits. 2013-11-27 19:21:23 +02:00
bootstrap Prevent memory leaks from accumulating across printtup() calls. 2013-11-03 11:33:05 -05:00
catalog Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
commands Don't update relfrozenxid if any pages were skipped. 2013-11-27 13:43:27 +02:00
executor Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
foreign Arrange to cache FdwRoutine structs in foreign tables' relcache entries. 2013-03-06 23:48:09 -05:00
lib Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
libpq Fix new and latent bugs with errno handling in secure_read/secure_write. 2013-11-24 13:09:38 -05:00
main Renovate display of non-ASCII messages on Windows. 2013-06-26 11:17:33 -04:00
nodes Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
optimizer Flatten join alias Vars before pulling up targetlist items from a subquery. 2013-11-22 14:37:21 -05:00
parser Fix array slicing of int2vector and oidvector values. 2013-11-23 20:03:56 -05:00
po Translation updates 2013-10-07 16:51:52 -04:00
port Remove IRIX port. 2013-10-18 08:14:21 -04:00
postmaster Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
regex Fix regex match failures for backrefs combined with non-greedy quantifiers. 2013-07-18 21:22:37 -04:00
replication Fix typo in comment. 2013-09-03 13:17:09 +03:00
rewrite Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
snowball Update copyrights for 2013 2013-01-01 17:15:01 -05:00
storage Fix stale-pointer problem in fast-path locking logic. 2013-11-27 18:10:00 -05:00
tcop Change SET LOCAL/CONSTRAINTS/TRANSACTION and ABORT behavior 2013-11-25 19:19:40 -05:00
tsearch pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
utils Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
Makefile Move relpath() to libpgcommon 2013-02-21 22:46:17 -03:00
common.mk Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
nls.mk Add libpgcommon to backend gettext source files 2013-10-19 13:49:05 -04:00