Re: t/035_standby_logical_decoding.pl might fail on attempt to read wrong timeline

Michael Paquier <michael@paquier.xyz>

From: Michael Paquier <michael@paquier.xyz>
To: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: Xuneng Zhou <xunengzhou@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>, Alexander Lakhin <exclusion@gmail.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2026-06-11T09:53:19Z
Lists: pgsql-hackers
On Thu, Jun 11, 2026 at 10:15:01AM +0900, Michael Paquier wrote:
> The backpatch of PG16 is straight-forward and adding
> GetWALInsertionTimeLineIfSet() down there does not look like an issue.
> Not having any tests in v16 feels sad, but that's life.  It does not
> prevent addressing the availability issue on this branch.

Backpatch of GetWALInsertionTimeLineIfSet() done in v16.

> I'll go take it up from here.

I have spent some time on the first part of this patch series,
focusing on the noisiest path for logical replication, and applied it
down to v17.  I have been able to reproduce the problem using
Alexander's sleep trick, and let 035 run with the same trick and the
patch applied for a few hundred runs.

Note that REL_17_STABLE has currently 4 failures in the buildfarm, due
to me messing up with the existence of injection_points.  I'll
probably just remove the test on this branch, 105b2cb33617 adding the
requirement on the module only in v18~.
--
Michael

Commits

  1. Fix second race with timeline selection during promotion

  2. Remove TAP test for timeline lookup race with logical decoding on standbys

  3. Fix race with timeline selection in logical decoding during promotion

  4. Backport GetWALInsertionTimeLineIfSet()

  5. TAP test for logical decoding on standby