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 27586CFC-D623-429E-BE91-9C83538D6E97@amazon.com
Whole thread Raw
In response to Re: archive status ".ready" files may be created too early  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Responses Re: archive status ".ready" files may be created too early
List pgsql-hackers
On 12/15/20, 2:33 AM, "Kyotaro Horiguchi" <horikyota.ntt@gmail.com> wrote:
> You're right in that regard. There's a window where partial record is
> written when write location passes F0 after insertion location passes
> F1. However, remembering all spanning records seems overkilling to me.

I'm curious why you feel that recording all cross-segment records is
overkill.  IMO it seems far simpler to just do that rather than try to
reason about all these different scenarios and rely on various
(and possibly fragile) assumptions.  You only need to record the end
location of records that cross into the next segment (or that fit
perfectly into the end of the current one) and to evaluate which
segments to mark .ready as the "flushed" LSN advances.  I'd expect
that in most cases we wouldn't need to store more than a couple of
record boundaries, so it's not like we'd normally be storing dozens of
boundaries.  Even if we did need to store several boundaries, AFAICT
the approach I'm proposing should still work well enough.

Nathan


pgsql-hackers by date:

Previous
From: Gilles Darold
Date:
Subject: Re: [UNVERIFIED SENDER] Re: [BUG] orphaned function
Next
From: Jeff Davis
Date:
Subject: Re: Minor documentation error regarding streaming replication protocol