Hi,

On Wed, Nov 4, 2026 at 1:09 PM Bharath Rupireddy
<[email protected]> wrote:
>
> > Regarding the code, state->seg.ws_tli cannot be updated if 
> > logical_read_xlog_page()
> > bypasses the actual WAL read. It seems to break the callback rule determined
> > in xlogheader.h:
>
> Yes, you are right. When the WAL is fully read from the buffers,
> ws_tli stays 0. For the existing physical walsender the first read
> always happens from a WAL file, as we attempt to read from the buffers
> with ws_tli 0. I can't think of any correctness issue, but it affects
> error reporting for file removal and validation checks. When reading
> from the buffers, the validation checks rarely fail, because the WAL
> pages are initialized atomically for next use.
>
> I would like to fix this by setting seg.ws_tli when we skip reading
> from the file.

Please find the attached v11 patches with the above change.

-- 
Bharath Rupireddy
Amazon Web Services: https://aws.amazon.com

Attachment: v11-0001-Use-WALReadFromBuffers-for-logical-walsenders.patch
Description: Binary data

Attachment: v11-0002-Use-WALReadFromBuffers-for-local-WAL-reads.patch
Description: Binary data

Attachment: v11-0003-Use-WALReadFromBuffers-for-WAL-summarizer.patch
Description: Binary data

Reply via email to