]> granicus.if.org Git - postgresql/commit
Fix low-probability bug in relcache startup: write_irels wrote the
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 31 Mar 2000 19:39:22 +0000 (19:39 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 31 Mar 2000 19:39:22 +0000 (19:39 +0000)
commit14bc951d30d9652bec2571fe2dcbe3f3d658a9b0
tree2f796826a88cc66f07928dd8b710d91aa9e3c8de
parentdbc9346f75b38095d9cfd28a2d24e4c814afc076
Fix low-probability bug in relcache startup: write_irels wrote the
pg_internal.init file in-place, which meant that if another backend
started at about the same time, it might read the incomplete file.
init_irels tries to guard against that, but I have now seen a crash
due to reading bad data from a partly-written file.  (This may indicate
a kernel bug on my platform?  Not sure.)  Anyway, clearly the safest
course is to write the new pg_internal.init file under a unique temporary
filename, and rename it into place only after it's all written.
src/backend/utils/cache/relcache.c