Re: archive status ".ready" files may be created too early - Mailing list pgsql-hackers

From Bossart, Nathan
Subject Re: archive status ".ready" files may be created too early
Date
Msg-id 20DC0D7B-E2DE-46BF-9DE4-D4D53A37E97D@amazon.com
Whole thread Raw
In response to Re: archive status ".ready" files may be created too early  (Andres Freund <andres@anarazel.de>)
Responses Re: archive status ".ready" files may be created too early  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On 8/31/21, 10:21 AM, "Andres Freund" <andres@anarazel.de> wrote:
> What would trigger the flushing? We don't write out partially filled pages
> unless
> a) we're explicitly flushing an LSN on the partial page (e.g. because a
>    synchronous commit record resides on it)
> b) there's an async commit (i.e. commit with synchronous_commit=off) on the
>    page

Ah, so your point is that an open transaction that has written a
partial page on the next segment wouldn't trigger a flush.  What
appears to happen in this case is that bgwriter eventually creates a
xl_running_xacts record and nudges walwriter to flush it to disk, at
which point the .ready file(s) will be created.  That's admittedly a
bit fragile.

Nathan


pgsql-hackers by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Bug fix for cache lookup failure for statistic_ext type
Next
From: John Naylor
Date:
Subject: mark the timestamptz variant of date_bin() as stable