pgsql: Recursively fsync() the data directory after a crash.

From: Robert Haas <rhaas(at)postgresql(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Recursively fsync() the data directory after a crash.
Date: 2015-05-04 18:23:00
Message-ID: E1YpL1A-0007Tz-Av@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/2ce439f3379aed857517c8ce207485655000fc8e

Modified Files
--------------
src/backend/access/transam/xlog.c | 42 ++++++++++++++
src/backend/storage/file/fd.c | 115 +++++++++++++++++++++++++++++++++++++
src/include/storage/fd.h | 2 +
3 files changed, 159 insertions(+)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2015-05-04 19:39:03 pgsql: Improve procost estimates for some text search functions.
Previous Message Heikki Linnakangas 2015-05-04 18:04:07 pgsql: Fix the same-rel optimization when creating WAL records.