]> 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 18:04:53 +0000 (14:04 -0400)
commit30ba0d0c21a825bc9c0565ea331be98068536b0e
treec98afd84e312eaf75a9225e92d93e8482c822b7c
parentf1d7516770739e1af5cf517c01aa3bfa7b02b86b
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/backend/utils/misc/guc.c
src/include/storage/fd.h
src/include/utils/guc.h