]> granicus.if.org Git - postgresql/commit
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:41:53 +0000 (12:41 -0400)
commit2bc3397168580a28a1f072bec46d395f4eb54c08
tree8e292849e795c4166a4fe7c7f6540b2785c1ad81
parent7c2ccb494c06aca6f09356a68411261458da00ae
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