pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sergey Tatarintsev <s.tatarintsev@postgrespro.ru>
To: pgsql-hackers <pgsql-hackers@lists.postgresql.org>
Subject: 004_timeline_switch TAP test may fail
Date: Tue, 16 Jun 2026 15:01:15 +0700
Message-ID: <fea4190e-f8b5-4432-a52d-bcbee5f34366@postgrespro.ru> (raw)

Hi hackers!

I found that after commit 7185eddf0522b3146ed1ff6e063e8e129e77c706 we 
got little omission
in TAP test 004_timeline_switch:
...
my $node_standby_1 = PostgreSQL::Test::Cluster->new('standby_1');
...
$node_primary->stop;

There is no guarantee that standby_1 and standby_2 was successfully 
connected to primary and start
streaming before primary stopped.

  I think we must ensure that primary knows about standby_1 and standby_2

-- 
With best regards,
Sergey Tatarintsev,
PostgresPro

Attachments:

  [text/x-patch] 0001-Fix-004_timeline_switch-TAP-test-wait-for-standbys-s.patch (1015B, ../fea4190e-f8b5-4432-a52d-bcbee5f34366@postgrespro.ru/2-0001-Fix-004_timeline_switch-TAP-test-wait-for-standbys-s.patch)
  download | inline diff:
From cede62e8da1441f0ed2abf9c23f7073deff6d838 Mon Sep 17 00:00:00 2001
From: Sergey Tatarintsev <s.tatarintsev@postgrespro.ru>
Date: Tue, 16 Jun 2026 11:57:39 +0700
Subject: [PATCH] Fix 004_timeline_switch TAP test: wait for standbys starts
 before primary stops

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

diff --git a/src/test/recovery/t/004_timeline_switch.pl b/src/test/recovery/t/004_timeline_switch.pl
index e0b3851927c..2c432b50e54 100644
--- a/src/test/recovery/t/004_timeline_switch.pl
+++ b/src/test/recovery/t/004_timeline_switch.pl
@@ -30,6 +30,10 @@ $node_standby_2->init_from_backup($node_primary, $backup_name,
 	has_streaming => 1);
 $node_standby_2->start;
 
+# Wait for standby_1 and standby_2 starts
+$node_primary->poll_query_until('postgres',
+	"SELECT count(1) = 2 FROM pg_stat_replication");
+
 # Create some content on primary
 $node_primary->safe_psql('postgres',
 	"CREATE TABLE tab_int AS SELECT generate_series(1,1000) AS a");
-- 
2.43.0



view thread (5+ messages)  latest in thread

Message-ID: <fea4190e-f8b5-4432-a52d-bcbee5f34366@postgrespro.ru>
Permalink:  ../fea4190e-f8b5-4432-a52d-bcbee5f34366@postgrespro.ru/
Also on:    postgresql.org/message-id/fea4190e-f8b5-4432-a52d-bcbee5f34366@postgrespro.ru

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: s.tatarintsev@postgrespro.ru, pgsql-hackers@lists.postgresql.org
  Subject: Re: 004_timeline_switch TAP test may fail
  In-Reply-To: <fea4190e-f8b5-4432-a52d-bcbee5f34366@postgrespro.ru>

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

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