pgsql: Fix another instability in recovery TAP test 004_timeline_switch

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix another instability in recovery TAP test 004_timeline_switch
Date: 2026-06-16 23:42:47
Message-ID: E1wZdQd-000drx-2A@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix another instability in recovery TAP test 004_timeline_switch

The test did not wait for the standby to be connected to the primary.
This breaks one assumption at the beginning of the test, where the
primary is stopped to ensure that all its records are flushed to both
standbys before moving on with its next steps.

If standby_1 finishes ahead of standby_2, the test would be able work
fine as the former waits for the latter. The opposite is not true,
standby_2 getting ahead of standby_1 would cause the test to fail on
timeout when standby_1 attempts to connect to standby_2.

This commit adds an additional polling query after the two standbys are
started, checking that both standbys are connected to the primary before
processing with the initial steps of the test.

Like 7185eddf0522, backpatch down to v14.

Author: Sergey Tatarintsev <s(dot)tatarintsev(at)postgrespro(dot)ru>
Reviewed-by: Ewan Young <kdbase(dot)hack(at)gmail(dot)com>
Discussion: https://postgr.es/m/fea4190e-f8b5-4432-a52d-bcbee5f34366@postgrespro.ru
Backpatch-through: 14

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3afabab78d2566a9c9d1761f1d152b550ff83566

Modified Files
--------------
src/test/recovery/t/004_timeline_switch.pl | 4 ++++
1 file changed, 4 insertions(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2026-06-17 01:14:50 pgsql: Fix to not allow null treatment to non window functions.
Previous Message Bruce Momjian 2026-06-16 17:28:50 pgsql: doc PG 19 relnotes: update to current