postgresql/src/backend/utils
Tom Lane 483b17119a Fix relcache reload mechanism to be more robust in the face of errors
occurring during a reload, such as query-cancel.  Instead of zeroing out
an existing relcache entry and rebuilding it in place, build a new relcache
entry, then swap its contents with the old one, then free the new entry.
This avoids problems with code believing that a previously obtained pointer
to a cache entry must still reference a valid entry, as seen in recent
failures on buildfarm member jaguar.  (jaguar is using CLOBBER_CACHE_ALWAYS
which raises the probability of failure substantially, but the problem
could occur in the field without that.)  The previous design was okay
when it was made, but subtransactions and the ResourceOwner mechanism
make it unsafe now.

Also, make more use of the already existing rd_isvalid flag, so that we
remember that the entry requires rebuilding even if the first attempt fails.

Back-patch as far as 8.2.  Prior versions have enough issues around relcache
reload anyway (due to inadequate locking) that fixing this one doesn't seem
worthwhile.
2010-01-12 18:12:40 +00:00
..
adt Make bit/varbit substring() treat any negative length as meaning "all the rest 2010-01-07 19:53:27 +00:00
cache Fix relcache reload mechanism to be more robust in the face of errors 2010-01-12 18:12:40 +00:00
error Ooops ... fix some confusion between gettext() and _() in my previous patch. 2009-03-03 00:17:22 +00:00
fmgr Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:30 +00:00
hash Fix dynahash.c to suppress hash bucket splits while a hash_seq_search() scan 2007-04-26 23:24:57 +00:00
init Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:30 +00:00
mb When we are in error recursion trouble, arrange to suppress translation and 2009-03-02 21:18:57 +00:00
misc Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:30 +00:00
mmgr Previous fix for temporary file management broke returning a set from 2009-12-29 17:41:26 +00:00
resowner Fix bug in temporary file management with subtransactions. A cursor opened 2009-12-03 11:03:55 +00:00
sort Previous fix for temporary file management broke returning a set from 2009-12-29 17:41:26 +00:00
time Repair two related errors in heap_lock_tuple: it was failing to recognize 2006-11-17 18:00:15 +00:00
.cvsignore
Gen_fmgrtab.sh Make Gen_fmgrtab.sh locale-proof. Per report from Marko Kreen and 2006-09-05 19:18:13 +00:00
Makefile Fix some makefiles that fail to yield good results from 'make -qp'. 2006-07-15 03:33:14 +00:00
probes.d DTrace support, with a small initial set of probes 2006-07-24 16:32:45 +00:00