postgresql/src
Tom Lane 38ef2e2fba Fix incorrect order of operations during sinval reset processing.
We have to be sure that we have revalidated each nailed-in-cache relcache
entry before we try to use it to load data for some other relcache entry.
The introduction of "mapped relations" in 9.0 broke this, because although
we updated the state kept in relmapper.c early enough, we failed to
propagate that information into relcache entries soon enough; in
particular, we could try to fetch pg_class rows out of pg_class before
we'd updated its relcache entry's rd_node.relNode value from the map.

This bug accounts for Dave Gould's report of failures after "vacuum full
pg_class", and I believe that there is risk for other system catalogs
as well.

The core part of the fix is to copy relmapper data into the relcache
entries during "phase 1" in RelationCacheInvalidate(), before they'll be
used in "phase 2".  To try to future-proof the code against other similar
bugs, I also rearranged the order in which nailed relations are visited
during phase 2: now it's pg_class first, then pg_class_oid_index, then
other nailed relations.  This should ensure that RelationClearRelation can
apply RelationReloadIndexInfo to all nailed indexes without risking use
of not-yet-revalidated relcache entries.

Back-patch to 9.0 where the relation mapper was introduced.
2011-08-16 14:38:35 -04:00
..
backend Fix incorrect order of operations during sinval reset processing. 2011-08-16 14:38:35 -04:00
bin Fix pg_restore's direct-to-database mode for standard_conforming_strings. 2011-07-28 14:07:09 -04:00
include Fix race condition in relcache init file invalidation. 2011-08-16 13:12:10 -04:00
interfaces Fix previous patch so it also works if not USE_SSL (mea culpa). 2011-07-24 23:29:15 -04:00
makefiles Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
pl Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
port Tag 9.0.4. 2011-04-15 00:15:53 -03:00
template Don't try to force use of -no-cpp-precomp on OS X. It's been five years 2010-08-02 04:51:25 +00:00
test Fix nested PlaceHolderVar expressions that appear only in targetlists. 2011-08-09 00:49:04 -04:00
timezone Update time zone data files to tzdata release 2011f. 2011-04-13 18:04:07 -04:00
tools Back-patch Fix bat file quoting of %ENV from commit 19b7fac8. 2011-07-04 10:12:27 -04:00
tutorial Remove copyright mention of Andrew Yu, per author's permission. 2010-02-02 18:52:02 +00:00
.gitignore Convert cvsignore to gitignore, and add .gitignore for build targets. 2010-09-22 12:57:06 +02:00
bcc32.mak Remove old-style win32 client-only visual c++ build infrastructure for everything except 2007-03-05 14:18:38 +00:00
DEVELOPERS Replace a couple of references to files that no longer exist in the source 2009-05-04 08:08:47 +00:00
Makefile Rethink the way walreceiver is linked into the backend. Instead than shoving 2010-01-20 09:16:24 +00:00
Makefile.global.in Accept slightly grotty coding in Makefile.global in order to keep the -L 2010-07-06 22:03:05 +00:00
Makefile.shlib Fix assorted issues with build and install paths containing spaces. 2011-06-14 16:41:23 -04:00
nls-global.mk Avoid error from mkdir if no languages are to be installed 2010-05-13 14:35:28 +00:00
win32.mak Update supported standalone VC++ version to 7.1+ only, and fix 2007-08-03 10:47:11 +00:00