postgresql/src/backend
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
..
access Fix wrong WAL info value generated when gistContinueInsert() performs an 2009-12-24 17:52:25 +00:00
bootstrap On systems that have setsid(2) (which should be just about everything except 2006-11-21 20:59:53 +00:00
catalog Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:30 +00:00
commands Previous fix for temporary file management broke returning a set from 2009-12-29 17:41:26 +00:00
executor Previous fix for temporary file management broke returning a set from 2009-12-29 17:41:26 +00:00
lib
libpq Set errno to zero before invoking SSL_read or SSL_write. It appears that 2009-12-30 03:46:08 +00:00
main Fix erroneous implementation of -s in postmaster.c (the switch doesn't take 2007-01-04 00:58:01 +00:00
nodes Fix an oversight in the code that makes transitive-equality deductions from 2008-12-01 21:06:31 +00:00
optimizer Partially revert my patch of 2008-11-12 that installed a limit on the number 2009-05-11 17:56:22 +00:00
parser Defend against null input in analyze_requires_snapshot(), per report 2009-01-30 16:59:16 +00:00
po Translation updates 2009-12-08 22:13:05 +00:00
port Call SetLastError(0) before calling the file mapping functions 2009-05-04 08:36:42 +00:00
postmaster Ignore attempts to set "application_name" in the connection startup packet. 2009-12-02 17:41:39 +00:00
regex Fix assorted security-grade bugs in the regex engine. All of these problems 2008-01-03 20:48:49 +00:00
rewrite Fix more problems with rewriter failing to set Query.hasSubLinks when inserting 2008-09-24 16:53:00 +00:00
storage Fix bug in temporary file management with subtransactions. A cursor opened 2009-12-03 11:03:55 +00:00
tcop Prevent indirect security attacks via changing session-local state within 2009-12-09 21:58:30 +00:00
utils Fix relcache reload mechanism to be more robust in the face of errors 2010-01-12 18:12:40 +00:00
Makefile On Windows, we know the backend stack size limit because we have to 2006-10-08 17:15:34 +00:00
nls.mk Install a more robust solution for the problem of infinite error-processing 2008-10-27 19:37:36 +00:00