At Tue, 11 Jun 2024 09:27:20 +0900, Michael Paquier <michael@paquier.xyz> wrote in
> On Thu, Jun 06, 2024 at 03:19:20PM +0900, Kyotaro Horiguchi wrote:
> > So, I believe the attached small patch fixes the behavior. I haven't
> > come up with a good test script for this issue. Something like
> > 026_overwrite_contrecord.pl might work, but this situation seems a bit
> > more complex than what it handles.
>
> Hmm. Indeed you will not be able to reuse the same trick with the end
> of a segment. Still you should be able to get a rather stable test by
> using the same tricks as 039_end_of_wal.pl to spawn a record across
> multiple pages, no?
With the trick, we could write a page-spanning record, but I'm not
sure we can control the behavior of XLogBackgroundFlush().
As Amit suggested, we have the option to create a variant of the
function that guarantees flushing WAL until the end.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center