OSDN Git Service

Arrange to fsync the contents of lockfiles (both postmaster.pid and the
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 16 Aug 2010 17:32:53 +0000 (17:32 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 16 Aug 2010 17:32:53 +0000 (17:32 +0000)
commitc93b652c2dbafa6b5d3e59ca8c68814c0b03f502
tree13d2ec5543901fbe77c9506ab88e1e13d30366dc
parent59ea02a108908e5814e5bda21a86b126b849a837
Arrange to fsync the contents of lockfiles (both postpid and the
socket lockfile) when writing them.  The lack of an fsync here may well
explain two different reports we've seen of corrupted lockfile contents,
which doesn't particularly bother the running server but can prevent a
new server from starting if the old one crashes.  Per suggestion from
Alvaro.

Back-patch to all supported versions.
src/backend/utils/init/miscinit.c