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

From Andres Freund
Subject Re: archive status ".ready" files may be created too early
Date
Msg-id 20210831171836.ww43agvczffdultp@alap3.anarazel.de
Whole thread Raw
In response to Re: archive status ".ready" files may be created too early  ("Bossart, Nathan" <bossartn@amazon.com>)
Responses Re: archive status ".ready" files may be created too early
List pgsql-hackers
Hi,

On 2021-08-31 17:01:31 +0000, Bossart, Nathan wrote:
> > If the record ending at s4 + 10 isn't an async commit (and thus
> > XLogCtl->asyncXactLSN is smaller), and there are no further records, we can
> > end up waiting effectively forever for s2 (and s3) to be archived. If all
> > other connections (and autovac etc) are idle, there will be no XLogFlush()
> > calls, nor will XLogBackgroundFlush() do anything, because it'll hit the "If
> > already known flushed" path, because the the first page in s4 is only
> > partially filled.
> 
> I'm not following why s4 wouldn't be flushed in this example.  Even if
> the first page in s4 is only partially filled, that portion of the
> record should still get flushed, and we'll create the .ready files for
> s2 and s3 at that time.

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

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Pavel Luzanov
Date:
Subject: Re: psql: \dl+ to list large objects privileges
Next
From: Zhihong Yu
Date:
Subject: Re: suboverflowed subtransactions concurrency performance optimize