postgresql/src/backend/utils/cache
Tom Lane 2ada6779c5 Fix race condition in relcache init file invalidation.
The previous code tried to synchronize by unlinking the init file twice,
but that doesn't actually work: it leaves a window wherein a third process
could read the already-stale init file but miss the SI messages that would
tell it the data is stale.  The result would be bizarre failures in catalog
accesses, typically "could not read block 0 in file ..." later during
startup.

Instead, hold RelCacheInitLock across both the unlink and the sending of
the SI messages.  This is more straightforward, and might even be a bit
faster since only one unlink call is needed.

This has been wrong since it was put in (in 2002!), so back-patch to all
supported releases.
2011-08-16 13:11:54 -04:00
..
attoptcache.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
catcache.c Pass collations to functions in FunctionCallInfoData, not FmgrInfo. 2011-04-12 19:19:24 -04:00
inval.c Fix race condition in relcache init file invalidation. 2011-08-16 13:11:54 -04:00
lsyscache.c Remove assumptions that not-equals operators cannot be in any opclass. 2011-07-06 14:53:16 -04:00
Makefile Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
plancache.c pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
relcache.c Fix race condition in relcache init file invalidation. 2011-08-16 13:11:54 -04:00
relmapper.c Avoid index rebuild for no-rewrite ALTER TABLE .. ALTER TYPE. 2011-07-18 11:04:43 -04:00
spccache.c Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
syscache.c Capitalization fixes 2011-06-19 00:37:30 +03:00
ts_cache.c pgindent run before PG 9.1 beta 1. 2011-04-10 11:42:00 -04:00
typcache.c Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00