postgresql/src/backend
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
..
access Typo fix. Kevin Grittner. 2010-04-14 20:17:26 +00:00
bootstrap pgindent run for 9.0 2010-02-26 02:01:40 +00:00
catalog Arrange to remove pg_default_acl entries completely if their ACL setting 2010-04-05 01:58:03 +00:00
commands Improve phrasing of warning message for NOTIFY queue getting too full. 2010-04-05 00:42:24 +00:00
executor Message tuning 2010-03-21 00:17:59 +00:00
foreign Wrap calls to SearchSysCache and related functions using macros. 2010-02-14 18:42:19 +00:00
lib Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
libpq Message tuning 2010-03-30 16:08:22 +00:00
main Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
nodes Fix "constraint_exclusion = partition" logic so that it will also attempt 2010-03-30 21:58:11 +00:00
optimizer Fix "constraint_exclusion = partition" logic so that it will also attempt 2010-03-30 21:58:11 +00:00
parser Pass incompletely-transformed aggregate argument lists as separate parameters 2010-03-17 16:52:38 +00:00
po Translation updates for 9.0alpha4 2010-02-19 00:40:05 +00:00
port pgindent run for 9.0 2010-02-26 02:01:40 +00:00
postmaster Make smart shutdown work in combination with Hot Standby/Streaming Replication. 2010-04-08 01:39:37 +00:00
regex pgindent run for 9.0 2010-02-26 02:01:40 +00:00
replication Only try to do a graceful disconnect if we've successfully loaded the 2010-04-13 08:16:09 +00:00
rewrite pgindent run for 9.0 2010-02-26 02:01:40 +00:00
snowball Update copyright for the year 2010. 2010-01-02 16:58:17 +00:00
storage Change some debug ereports to elogs, as requested by translation team. 2010-04-06 10:50:57 +00:00
tcop Message tuning 2010-03-21 00:17:59 +00:00
tsearch Allow underscores in tsearch email addressses, per RFC 5322 and report 2010-03-13 00:41:58 +00:00
utils Fix a problem introduced by my patch of 2010-01-12 that revised the way 2010-04-14 21:31:11 +00:00
Makefile Well, the systemtap guys moved the goalposts again: with the latest version, 2010-01-20 23:12:03 +00:00
common.mk Expand test coverage support to entire tree 2009-08-07 20:50:22 +00:00
nls.mk Convert the core lexer and parser into fully reentrant code, by making use 2009-07-13 02:02:20 +00:00