pgsql: Fix recovery target test waiting on unavailable WAL

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix recovery target test waiting on unavailable WAL
Date: 2026-07-20 18:28:05
Message-ID: E1wlsij-000000003oZ-0bcX@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix recovery target test waiting on unavailable WAL

Buildfarm member skink reported a failure in
recovery/003_recovery_targets after commit d5751c33cc3. The newly
added recovery_target_xid set-then-cleared test could time out while
waiting for pg_last_wal_replay_lsn() to reach the expected LSN.

The test recorded lsn6 after calling pg_switch_wal(). As a result,
lsn6 pointed into the next WAL segment, but pg_switch_wal() only
archived the previous one. Since the standby in this test restores WAL
from the archive only, it could not obtain the segment containing
lsn6 and waited indefinitely.

Fix this by recording lsn6 before calling pg_switch_wal(), so the
archived WAL contains the LSN that the standby is waiting for.

Per buildfarm member skink.

Reported-by: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
Author: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/al5Y2mWffRs1NP34@alvherre.pgsql

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/83486b6a65aa48ed18e4e872d5e0fb5b0bfaca41

Modified Files
--------------
src/test/recovery/t/003_recovery_targets.pl | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2026-07-21 00:12:37 pgsql: Add logical decoding status to pg_control_checkpoint().
Previous Message Robert Haas 2026-07-20 18:08:24 pgsql: doc: Granting TRIGGER or REFERENCES on table is dangerous.