postgresql/src/backend
Tom Lane a2e923a652 Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan
is in progress on the same hashtable.  This seems the least invasive way to
fix the recently-recognized problem that a split could cause the scan to
visit entries twice or (with much lower probability) miss them entirely.
The only field-reported problem caused by this is the "failed to re-find
shared lock object" PANIC in COMMIT PREPARED reported by Michel Dorochevsky,
which was caused by multiply visited entries.  However, it seems certain
that mdsync() is vulnerable to missing required fsync's due to missed
entries, and I am fearful that RelationCacheInitializePhase2() might be at
risk as well.  Because of that and the generalized hazard presented by this
bug, back-patch all the supported branches.

Along the way, fix pg_prepared_statement() and pg_cursor() to not assume
that the hashtables they are examining will stay static between calls.
This is risky regardless of the newly noted dynahash problem, because
hash_seq_search() has never promised to cope with deletion of table entries
other than the just-returned one.  There may be no bug here because the only
supported way to call these functions is via ExecMakeTableFunctionResult()
which will cycle them to completion before doing anything very interesting,
but it seems best to get rid of the assumption.  This affects 8.2 and HEAD
only, since those functions weren't there earlier.
2007-04-26 23:24:46 +00:00
..
access Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:24:46 +00:00
bootstrap First phase of plan-invalidation project: create a plan cache management 2007-03-13 00:33:44 +00:00
catalog Support explicit placement of the temporary-table schema within search_path. 2007-04-20 02:37:38 +00:00
commands Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:24:46 +00:00
executor Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:24:46 +00:00
lib Remove the currently unused FRONTEND case in dllist.c. This allows the usage 2007-03-22 18:57:52 +00:00
libpq Now that core functionality is depending on autoconf's AC_C_BIGENDIAN to be 2007-04-06 05:36:51 +00:00
main Cleanup the bootstrap code a little, and rename "dummy procs" in the code 2007-03-07 13:35:03 +00:00
nodes Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:24:46 +00:00
optimizer Some further performance tweaks for planning large inheritance trees that 2007-04-21 21:01:45 +00:00
parser Rename the newly-added commands for discarding session state. 2007-04-26 16:13:15 +00:00
po Translation updates 2006-12-02 01:16:16 +00:00
port Set maximum semaphore count to 32767 instead of 1. Fixes 2007-04-24 12:25:18 +00:00
postmaster Adjust pgstat_initstats() to avoid repeated searches of the TabStat arrays 2007-04-21 04:10:53 +00:00
regex Wording cleanup for error messages. Also change can't -> cannot. 2007-02-01 19:10:30 +00:00
rewrite Changes pg_trigger and extend pg_rewrite in order to allow triggers and 2007-03-19 23:38:32 +00:00
storage Add comment on why deadlock detection error messages only prints numbers. 2007-04-20 20:15:52 +00:00
tcop Rename the newly-added commands for discarding session state. 2007-04-26 16:13:15 +00:00
utils Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:24:46 +00:00
Makefile Replace useless uses of := by = in makefiles. 2007-02-09 15:56:00 +00:00
nls.mk Add _ to gettext triggers. Must have been forgotten here when it was introduced. 2005-10-04 11:14:03 +00:00