Re: Potential data loss of 2PC files

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Potential data loss of 2PC files
Date: 2016-12-27 05:09:05
Message-ID: CAB7nPqQx2rQ+h_NHzHr444RBSjVXSo1n-cqf9+gZFiQOBatgMw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 23, 2016 at 3:02 AM, Andres Freund <andres(at)anarazel(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2016-12-27 05:31:36 Re: Partition-wise join for join between (declaratively) partitioned tables
Previous Message Michael Paquier 2016-12-27 04:31:28 Re: Speedup twophase transactions