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