postgresql/src/include
Tom Lane 2065dd2834 Prevent very-low-probability PANIC during PREPARE TRANSACTION.
The code in PostPrepare_Locks supposed that it could reassign locks to
the prepared transaction's dummy PGPROC by deleting the PROCLOCK table
entries and immediately creating new ones.  This was safe when that code
was written, but since we invented partitioning of the shared lock table,
it's not safe --- another process could steal away the PROCLOCK entry in
the short interval when it's on the freelist.  Then, if we were otherwise
out of shared memory, PostPrepare_Locks would have to PANIC, since it's
too late to back out of the PREPARE at that point.

Fix by inventing a dynahash.c function to atomically update a hashtable
entry's key.  (This might possibly have other uses in future.)

This is an ancient bug that in principle we ought to back-patch, but the
odds of someone hitting it in the field seem really tiny, because (a) the
risk window is small, and (b) nobody runs servers with maxed-out lock
tables for long, because they'll be getting non-PANIC out-of-memory errors
anyway.  So fixing it in HEAD seems sufficient, at least until the new
code has gotten some testing.
2013-01-13 22:20:22 -05:00
..
access Redesign the planner's handling of index-descent cost estimation. 2013-01-11 12:56:58 -05:00
bootstrap Update copyrights for 2013 2013-01-01 17:15:01 -05:00
catalog Update copyrights for 2013 2013-01-01 17:15:01 -05:00
commands Update copyrights for 2013 2013-01-01 17:15:01 -05:00
datatype Update copyrights for 2013 2013-01-01 17:15:01 -05:00
executor Invent a "one-shot" variant of CachedPlans for better performance. 2013-01-04 17:42:19 -05:00
foreign Update copyrights for 2013 2013-01-01 17:15:01 -05:00
lib Update copyrights for 2013 2013-01-01 17:15:01 -05:00
libpq Update copyrights for 2013 2013-01-01 17:15:01 -05:00
mb Update copyrights for 2013 2013-01-01 17:15:01 -05:00
nodes Redesign the planner's handling of index-descent cost estimation. 2013-01-11 12:56:58 -05:00
optimizer Update copyrights for 2013 2013-01-01 17:15:01 -05:00
parser Update copyrights for 2013 2013-01-01 17:15:01 -05:00
port Add URLs to document why DLLIMPORT is needed on Windows. 2012-11-07 15:01:25 -05:00
portability Update copyrights for 2013 2013-01-01 17:15:01 -05:00
postmaster Fix background workers for EXEC_BACKEND 2013-01-02 12:01:14 -03:00
regex Re-implement extraction of fixed prefixes from regular expressions. 2012-07-10 14:54:37 -04:00
replication Update copyrights for 2013 2013-01-01 17:15:01 -05:00
rewrite Update copyrights for 2013 2013-01-01 17:15:01 -05:00
snowball Update copyrights for 2013 2013-01-01 17:15:01 -05:00
storage Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tcop Update copyrights for 2013 2013-01-01 17:15:01 -05:00
tsearch Update copyrights for 2013 2013-01-01 17:15:01 -05:00
utils Prevent very-low-probability PANIC during PREPARE TRANSACTION. 2013-01-13 22:20:22 -05:00
.gitignore Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
c.h Improve handling of ereport(ERROR) and elog(ERROR). 2013-01-13 18:40:09 -05:00
fmgr.h Update copyrights for 2013 2013-01-01 17:15:01 -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
Makefile Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
miscadmin.h Make sure MaxBackends is always set 2013-01-02 14:39:11 -03:00
pg_config.h.in Improve handling of ereport(ERROR) and elog(ERROR). 2013-01-13 18:40:09 -05:00
pg_config.h.win32 Improve handling of ereport(ERROR) and elog(ERROR). 2013-01-13 18:40:09 -05: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 Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pg_trace.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pgstat.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
pgtar.h Move tar function headers to pgtar.h 2013-01-02 20:34:08 +01:00
pgtime.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
port.h Centralize single quote escaping in src/port/quotes.c 2013-01-05 15:40:19 +01:00
postgres.h Update copyrights for 2013 2013-01-01 17:15:01 -05:00
postgres_ext.h Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
postgres_fe.h Update copyrights for 2013 2013-01-01 17:15:01 -05: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