aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gistget.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-16 13:12:29 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-16 13:12:29 -0400
commit44631eec3298d25b7b6fa71fc237c076f4e2a3a3 (patch)
tree6f1f26f431f2a49497874c87f2487aef90a7de21 /src/backend/access/gist/gistget.c
parent443a44ba62c3b3089456ddcf72df695d3c77bee3 (diff)
downloadpostgresql-44631eec3298d25b7b6fa71fc237c076f4e2a3a3.tar.gz
postgresql-44631eec3298d25b7b6fa71fc237c076f4e2a3a3.zip
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.
Diffstat (limited to 'src/backend/access/gist/gistget.c')
0 files changed, 0 insertions, 0 deletions