postgresql/src/include
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 Update copyrights for 2013 2013-01-01 17:15:01 -05:00
catalog Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
commands Allow aggregates to provide estimates of their transition state data size. 2013-11-16 16:03:40 -05:00
common Replace pg_asprintf() with psprintf(). 2013-10-22 19:40:26 -04:00
datatype Update copyrights for 2013 2013-01-01 17:15:01 -05:00
executor Prevent leakage of SPI tuple tables during subtransaction abort. 2013-07-25 16:46:14 -04:00
foreign Improve updatability checking for views and foreign tables. 2013-06-12 17:53:33 -04:00
lib Use improved vsnprintf calling logic in more places. 2013-10-24 21:43:57 -04:00
libpq Add large object functions catering to SQL callers. 2013-10-27 22:56:54 -04:00
mb 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 Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
parser Support multi-argument UNNEST(), and TABLE() syntax for multiple functions. 2013-11-21 19:37:20 -05:00
port Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
portability Allow dynamic allocation of shared memory segments. 2013-10-09 21:05:02 -04:00
postmaster Provide a reliable mechanism for terminating a background worker. 2013-10-18 10:23:11 -04:00
regex Fix old typo in comment. 2013-10-29 15:34:18 -04:00
replication pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
rewrite Allow only some columns of a view to be auto-updateable. 2013-10-18 10:35:36 -04: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 pgindent run for release 9.3 2013-05-29 16:58:43 -04:00
tsearch Update copyrights for 2013 2013-01-01 17:15:01 -05:00
utils Implement information_schema.parameters.parameter_default column 2013-11-26 23:21:35 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
Makefile Remove maintainer-check target, fold into normal build 2013-10-10 20:11:56 -04:00
c.h Consistently use unsigned arithmetic for alignment calculations. 2013-10-20 21:04:52 -04:00
fmgr.h Add infrastructure for storing a VARIADIC ANY function's VARIADIC flag. 2013-01-21 20:26:15 -05:00
funcapi.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
getaddrinfo.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
getopt_long.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
miscadmin.h Remove CTimeZone/HasCTZSet, root and branch. 2013-11-01 13:57:31 -04:00
pg_config.h.in Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
pg_config.h.win32 Revert WAL posix_fallocate() patches. 2013-09-04 23:43:41 -07:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.win32 Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_manual.h Keep heavily-contended fields in XLogCtlInsert on different cache lines. 2013-09-04 23:14:33 +03:00
pg_trace.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pgstat.h Split pgstat file in smaller pieces 2013-02-18 18:12:52 -03:00
pgtar.h Move tar function headers to pgtar.h 2013-01-02 20:34:08 +01:00
pgtime.h Fix some odd behaviors when using a SQL-style simple GMT offset timezone. 2013-11-01 12:13:18 -04:00
port.h Get rid of use of asprintf() in favor of a more portable implementation. 2013-10-22 18:42:13 -04:00
postgres.h Add comment for VARSIZE_ANY_EXHDR macro 2013-09-10 20:18:53 -04:00
postgres_ext.h Provide database object names as separate fields in error messages. 2013-01-29 17:08:26 -05:00
postgres_fe.h Create libpgcommon, and move pg_malloc et al to it 2013-02-12 11:21:05 -03:00
rusagestub.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
windowapi.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00