postgresql/src
Tom Lane f4d7f1adba 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:20 -04:00
..
backend Fix incorrect order of operations during sinval reset processing. 2011-08-16 14:38:20 -04:00
bin Adjust total size in pg_basebackup progress report when reality changes 2011-08-16 16:58:58 +02:00
include Fix race condition in relcache init file invalidation. 2011-08-16 13:11:54 -04:00
interfaces Tweak PQresStatus() to avoid a clang compiler warning. 2011-08-05 12:06:29 -04:00
makefiles Add some environment checks prior to sepgsql regression testing. 2011-07-25 10:51:02 -04:00
pl Restore the primacy of postgres.h in plpython.c. 2011-08-04 13:05:32 -04:00
port Make pgbench use erand48() rather than random(). 2011-08-03 16:26:40 -04:00
template
test Adjust regression tests for error message change 2011-08-15 17:27:10 +03:00
timezone Replace printf format %i by %d 2011-07-26 22:54:29 +03:00
tools Blind attempt at fixing isolation_tester on Win32 2011-07-13 01:10:26 -04:00
tutorial
.gitignore
bcc32.mak
DEVELOPERS
Makefile
Makefile.global.in Make distprep and *clean build targets recurse into all subdirectories. 2011-07-03 13:55:12 -04:00
Makefile.shlib Use single quotes in preference to double quotes for protecting pathnames. 2011-06-15 21:45:23 -04:00
nls-global.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00
win32.mak