Re: [HACKERS] Potential data loss of 2PC files - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [HACKERS] Potential data loss of 2PC files
Date
Msg-id CAB7nPqQx2rQ+h_NHzHr444RBSjVXSo1n-cqf9+gZFiQOBatgMw@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] Potential data loss of 2PC files  (Andres Freund <andres@anarazel.de>)
Responses Re: [HACKERS] Potential data loss of 2PC files
List pgsql-hackers
On Fri, Dec 23, 2016 at 3:02 AM, Andres Freund <andres@anarazel.de> wrote:
> Not quite IIRC: that doesn't deal with file size increase.  All this would be easier if hardlinks wouldn't exist
IIUC.It's basically a question whether dentry, inode or contents need to be synced.   Yes, it sucks.
 

I did more monitoring of the code... Looking at unlogged tables and
empty() routines of access methods, isn't there a risk as well for
unlogged tables? mdimmedsync() does not fsync() the parent directory
either! It seems to me that we want to fsync() the parent folder in
this code path especially and not just at checkpoint as this assumes
that it does not care about shared buffers. We could do that at
checkpoint as well, actually, by looping through all the tablespaces
and fsync the database directories.

Robert, as the former author of unlogged tables and Andres, as you
have done a lot of work on durability, could you share your opinion on
the matter? Of course opinions of others are welcome!
-- 
Michael



pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: [HACKERS] Speedup twophase transactions
Next
From: Ashutosh Bapat
Date:
Subject: Re: [HACKERS] Partition-wise join for join between (declaratively)partitioned tables