postgresql/src/backend
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
..
access Fix race condition in relcache init file invalidation. 2011-08-16 13:11:54 -04:00
bootstrap Avoid index rebuild for no-rewrite ALTER TABLE .. ALTER TYPE. 2011-07-18 11:04:43 -04:00
catalog Unbreak legacy syntax "COMMENT ON RULE x IS y", with no relation name. 2011-08-11 11:23:51 -04:00
commands Fix unsafe order of operations in foreign-table DDL commands. 2011-08-14 15:40:21 -04:00
executor Avoid integer overflow when LIMIT + OFFSET >= 2^63. 2011-08-02 10:47:17 +03:00
foreign Clean up most -Wunused-but-set-variable warnings from gcc 4.6 2011-04-11 22:28:45 +03:00
lib Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
libpq Use clearer notation for getnameinfo() return handling 2011-08-09 18:30:32 +03:00
main Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
nodes Allow per-column foreign data wrapper options. 2011-08-05 13:24:03 -04:00
optimizer Avoid creating PlaceHolderVars immediately within PlaceHolderVars. 2011-08-09 11:34:20 -04:00
parser Allow per-column foreign data wrapper options. 2011-08-05 13:24:03 -04:00
po Fixed string in German translation that causes segfault. 2011-06-20 13:53:15 +02:00
port Teach unix_latch.c to use poll() where available. 2011-08-11 12:50:22 -04:00
postmaster Add a bit of debug logging to backend_read_statsfile(). 2011-08-10 16:45:43 -04:00
regex Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
replication Remove wal_sender_delay GUC, because it's no longer useful. 2011-08-10 18:50:28 -04:00
rewrite Try to acquire relation locks in RangeVarGetRelid. 2011-07-08 22:19:30 -04:00
snowball Stamp copyrights for year 2011. 2011-01-01 13:18:15 -05:00
storage Add "Reason code" prefix to internal SSI error messages 2011-08-15 15:20:16 +03:00
tcop Change the autovacuum launcher to use WaitLatch instead of a poll loop. 2011-08-10 12:22:21 -04:00
tsearch Pgindent run before 9.1 beta2. 2011-06-09 14:32:50 -04:00
utils Fix race condition in relcache init file invalidation. 2011-08-16 13:11:54 -04:00
.gitignore Add gitignore for mingw/cygwin build outputs 2011-06-09 18:11:47 +02:00
common.mk Workaround for recursive make breakage 2011-01-13 09:32:06 +02:00
Makefile Fix symlink for errcodes.h so it works in VPATH builds from tarballs. 2011-06-22 13:08:08 -04:00
nls.mk Add the possibility to pass --flag arguments to xgettext calls 2011-06-27 00:37:21 +03:00