agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
To: Alexander Lakhin <exclusion@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline
Date: Sat, 6 Jun 2026 11:07:11 +0000
Message-ID: <aiP/X1FThlZRCFiN@bdtpg> (raw)
In-Reply-To: <7daef094-abf3-4672-bc23-3df4763b16a3@gmail.com>
References: <7daef094-abf3-4672-bc23-3df4763b16a3@gmail.com>

Hi Alexander,

On Sat, Jun 06, 2026 at 12:00:00PM +0300, Alexander Lakhin wrote:
> Hello hackers,
> 
> That is, walsender requested WAL segment for timeline 1, while in a
> successful run, it reads WAL for timeline 2.
> 
> I've managed to reproduce this failure with:

Thanks for the report and the repro!

> As far as I can see, the timeline is chosen in logical_read_xlog_page()
> depending on the recovery state:
>         am_cascading_walsender = RecoveryInProgress();
> 
>         if (am_cascading_walsender)
>                 GetXLogReplayRecPtr(&currTLI);
>         else
>                 currTLI = GetWALInsertionTimeLine();

Yeah, it looks like there is a race condition here. I think we should check if
the insertion timeline has already been set (like the walsummarizer is doing).

I'll work on a fix early next week.

Regards,

-- 
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com





view thread (24+ messages)  latest in thread

Message-ID: <aiP/X1FThlZRCFiN@bdtpg>
Permalink:  ../aiP%2FX1FThlZRCFiN@bdtpg/
Also on:    postgresql.org/message-id/aiP/X1FThlZRCFiN@bdtpg

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: bertranddrouvot.pg@gmail.com, exclusion@gmail.com
  Subject: Re: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline
  In-Reply-To: <aiP/X1FThlZRCFiN@bdtpg>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox