Re: Fails to work on live images due to fsync() on pg_commit_ts before doing any write there

From: Andres Freund <andres(at)anarazel(dot)de>
To: Raphael Hertzog <hertzog(at)debian(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Fails to work on live images due to fsync() on pg_commit_ts before doing any write there
Date: 2017-11-07 15:32:11
Message-ID: 20171107153211.d6io4ozig57eka6r@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2017-11-07 16:23:21 +0100, Raphael Hertzog wrote:
> On Tue, 07 Nov 2017, Tom Lane wrote:
> > Yeah, it does sound more like a filesystem bug than anything else.
> > (I completely reject the notion that it's an application error to
> > fsync a directory when you haven't modified it.)
> >
> > In view of the fact that we just wrapped 10.1, it'd be 3 months before
> > any change from our side would reach the wild. I think a key question
> > here is whether the Kali developers are likely to fix it from their side
> > in less time than that.
>
> Fix what?
>
> Following your logic, if anything needs to be fixed, it's the Linux kernel
> that has to be fixed, and in particular its overlayfs filesystem.

Right. The kernel knows the file/directory ain't dirty. We don't.

> The time
> to get a fix there is also relatively long. If they work on a fix quickly,
> it might get merged for Linux 3.15 which we will not have in Kali before
> 2-3 months too.

So the same timeframe as a new PG release?

> For now, I have added an ugly work-around that creates a file in the
> pg_commit_ts directory (and immediately drops it) just before starting
> PostgreSQL:
> http://git.kali.org/gitweb/?p=packages/kali-defaults.git;a=commitdiff;h=f4287fd774f8d0686ba919f57355215a6b9633e3

Hm. The comment:
+ # Ensure the directory is copied over in the tmpfs
suggests that the overlay isn't persistent? If that's indeed the case,
you could just disable fsyncs alltogether.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Raphael Hertzog 2017-11-07 16:23:20 Re: Fails to work on live images due to fsync() on pg_commit_ts before doing any write there
Previous Message Raphael Hertzog 2017-11-07 15:23:21 Re: Fails to work on live images due to fsync() on pg_commit_ts before doing any write there