]> granicus.if.org Git - postgresql/commit
Recursively fsync() the data directory after a crash.
authorRobert Haas <rhaas@postgresql.org>
Mon, 4 May 2015 18:13:53 +0000 (14:13 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 4 May 2015 18:13:53 +0000 (14:13 -0400)
commit2ce439f3379aed857517c8ce207485655000fc8e
tree196ccf42f41939b101aa6d4587ca93c8060b51a2
parentec3d976bce7e322c29f1007d19b63b7a3a1a6ee4
Recursively fsync() the data directory after a crash.

Otherwise, if there's another crash, some writes from after the first
crash might make it to disk while writes from before the crash fail
to make it to disk.  This could lead to data corruption.

Back-patch to all supported versions.

Abhijit Menon-Sen, reviewed by Andres Freund and slightly revised
by me.
src/backend/access/transam/xlog.c
src/backend/storage/file/fd.c
src/include/storage/fd.h