Re: Allow reading LSN written by walreciever, but not flushed yet - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: Allow reading LSN written by walreciever, but not flushed yet
Date
Msg-id F480CB4D-BF88-44CD-9FFD-E0C82D00FFCE@yandex-team.ru
Whole thread Raw
In response to Re: Allow reading LSN written by walreciever, but not flushed yet  (Rahila Syed <rahilasyed90@gmail.com>)
List pgsql-hackers

> On 6 Oct 2025, at 11:16, Rahila Syed <rahilasyed90@gmail.com> wrote:
>
> Can you please explain the scenarios in which the record pointer of the WAL record written
> by the receiver can move backwards.
> For example, in physical replication, the WAL records are sent after a Flush on the primary in ascending
> order of XLogRecPtr. They are also received in that order and written as they arrive by the receiver.
> Are you referring to crash scenarios where unflushed WAL may be discarded and receiver has
> to move backwards and start from the last flushed record on the standby?

I see at least two scenarios:

1. We observe writtenUpto, then system is rebooted and we observe lesser writtenUpto.
2. We observe writtenUpto on one timeline, standby is kill-9-ed and another primary sends timeline change between
flushedand previously observed write ptr 

If at some point primary will be sending unflushed WAL, this list will grow with possible gray areas on Primary.


Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Bertrand Drouvot
Date:
Subject: Re: Add stats_reset to pg_stat_all_tables|indexes and related views
Next
From: Michael Banck
Date:
Subject: Re: Should we update the random_page_cost default value?