Re: [BUGS] Fails to work on live images due to fsync() onpg_commit_ts before doing any write there - Mailing list pgsql-bugs

From Andres Freund
Subject Re: [BUGS] Fails to work on live images due to fsync() onpg_commit_ts before doing any write there
Date
Msg-id 20171107151347.77vumrbitqbzdzaf@alap3.anarazel.de
Whole thread Raw
In response to Re: [BUGS] Fails to work on live images due to fsync() onpg_commit_ts before doing any write there  (Raphael Hertzog <hertzog@debian.org>)
List pgsql-bugs
On 2017-11-07 16:06:02 +0100, Raphael Hertzog wrote:
> On Tue, 07 Nov 2017, Stephen Frost wrote:
> > Raphael,
> > 
> > * Raphael Hertzog (hertzog@debian.org) wrote:
> > > Still I believe that this issue should be fixed in both sides. It's not
> > > smart from PostgreSQL to call fsync() when it has not made any change.
> > 
> > Why?
> 
> Because it's useless. Why call fsync() when you know that it doesn't do
> anything?

It's not generally useless, no. You don't know if the relevant directory
hasn't been modified since postgres was started last / crashed
last. That matters for the durability and atomicity of renames
etc. There's simply no way to track that in postgres, given it's
arbitrary external effects.

Greetings,

Andres Freund


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

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: [BUGS] Fails to work on live images due to fsync() on pg_commit_ts before doing any write there
Next
From: Raphael Hertzog
Date:
Subject: Re: [BUGS] Fails to work on live images due to fsync() onpg_commit_ts before doing any write there