pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Teodor Sigaev <teodor@sigaev.ru>
To: pgsql-committers@postgresql.org
Subject: pgsql: Fsync directory after creating or unlinking file.
Date: Mon, 27 Mar 2017 16:33:50 +0000
Message-ID: <E1csXaY-0000dh-Fu@gemulon.postgresql.org> (raw)
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

Fsync directory after creating or unlinking file.

If file was created/deleted just before powerloss it's possible that
file system will miss that. To prevent it, call fsync() where creating/
unlinkg file is critical.

Author: Michael Paquier
Reviewed-by: Ashutosh Bapat, Takayuki Tsunakawa, me

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/1b02be21f271db6bd3cd43abb23fa596fcb6bac3

Modified Files
--------------
src/backend/access/transam/clog.c      | 14 +++++++++++++
src/backend/access/transam/commit_ts.c | 12 +++++++++++
src/backend/access/transam/twophase.c  |  8 ++++++++
src/backend/access/transam/xlog.c      | 19 ++++++-----------
src/backend/storage/file/fd.c          | 37 ++++++++++++++++++++++++++++++++++
src/include/storage/fd.h               |  1 +
6 files changed, 78 insertions(+), 13 deletions(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


Message-ID: <E1csXaY-0000dh-Fu@gemulon.postgresql.org>
Permalink:  ../E1csXaY-0000dh-Fu@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1csXaY-0000dh-Fu@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: teodor@sigaev.ru
  Subject: Re: pgsql: Fsync directory after creating or unlinking file.
  In-Reply-To: <E1csXaY-0000dh-Fu@gemulon.postgresql.org>
  References: <E1csXaY-0000dh-Fu@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox