Recursively fsync() the data directory after a crash.
authorRobert Haas <rhaas@postgresql.org>
Mon, 4 May 2015 16:06:53 +0000 (12:06 -0400)
committerRobert Haas <rhaas@postgresql.org>
Mon, 4 May 2015 16:27:55 +0000 (12:27 -0400)
commit14de825dee324cb6b1e8298ee845e1134edcc33e
tree8a24ab6a2efa90322632684d29513b9d75197357
parente60581fdf3dee39d189925673ec17d2c794e84b5
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