postgresql/src/backend/utils
Tom Lane 73981cb451 Fix a problem introduced by my patch of 2010-01-12 that revised the way
relcache reload works.  In the patched code, a relcache entry in process of
being rebuilt doesn't get unhooked from the relcache hash table; which means
that if a cache flush occurs due to sinval queue overrun while we're
rebuilding it, the entry could get blown away by RelationCacheInvalidate,
resulting in crash or misbehavior.  Fix by ensuring that an entry being
rebuilt has positive refcount, so it won't be seen as a target for removal
if a cache flush occurs.  (This will mean that the entry gets rebuilt twice
in such a scenario, but that's okay.)  It appears that the problem can only
arise within a transaction that has previously reassigned the relfilenode of
a pre-existing table, via TRUNCATE or a similar operation.  Per bug #5412
from Rusty Conover.

Back-patch to 8.2, same as the patch that introduced the problem.
I think that the failure can't actually occur in 8.2, since it lacks the
rd_newRelfilenodeSubid optimization, but let's make it work like the later
branches anyway.

Patch by Heikki, slightly editorialized on by me.
2010-04-14 21:31:11 +00:00
..
adt Fix to_char YYY, YY, Y format codes so that FM zero-suppression really works, 2010-04-07 21:41:53 +00:00
cache Fix a problem introduced by my patch of 2010-01-12 that revised the way 2010-04-14 21:31:11 +00:00
error pgindent run for 9.0 2010-02-26 02:01:40 +00:00
fmgr pgindent run for 9.0 2010-02-26 02:01:40 +00:00
hash pgindent run for 9.0 2010-02-26 02:01:40 +00:00
init Modify some new and pre-existing messages for translatability. 2010-03-25 20:40:17 +00:00
mb Undo some more pgindent breakage. Per buildfarm. 2010-02-27 03:55:52 +00:00
misc Change the logic to decide when to delete old WAL segments, so that it 2010-04-12 09:52:29 +00:00
mmgr pgindent run for 9.0 2010-02-26 02:01:40 +00:00
resowner Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
sort pgindent run for 9.0 2010-02-26 02:01:40 +00:00
time pgindent run for 9.0 2010-02-26 02:01:40 +00:00
.cvsignore Cleanup to ensure good state of derived files in tarballs. 2000-06-09 02:38:36 +00:00
Gen_dummy_probes.sed Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
Gen_fmgrtab.pl Fix genbki.pl and Gen_fmgrtab.pl to use PID-specific temp file names, 2010-01-05 20:23:32 +00:00
Makefile Get rid of the need for manual maintenance of the initial contents of 2010-01-05 01:06:57 +00:00
probes.d Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00