diff options
author | Amit Kapila <akapila@postgresql.org> | 2023-12-05 09:10:06 +0530 |
---|---|---|
committer | Amit Kapila <akapila@postgresql.org> | 2023-12-05 09:10:06 +0530 |
commit | 63c5df126abb7364b70dafe75fef576dd8eb0bbc (patch) | |
tree | 6e4d80aa7c7b0acd90cd4b0e43ef4eb68816aa05 | |
parent | a86c61c9eefaba7dcf375cd60c875c871ed60945 (diff) | |
download | postgresql-63c5df126abb7364b70dafe75fef576dd8eb0bbc.tar.gz postgresql-63c5df126abb7364b70dafe75fef576dd8eb0bbc.zip |
Fix a random failure in 003_logical_slots.pl.
The failed test was trying to validate that the two_phase option for a
slot is retained after the upgrade. The problem was that it didn't get
enabled before the upgrade so expecting to be enabled after the upgrade
was not right in the first place. This is a timing issue because we enable
the two_phase once the initial sync for all the tables is finished.
Normally, we wait for the two_phase state to be enabled but this test
missed that step.
Per buildfarm.
Author: Hayato Kuroda
Discussion: https://postgr.es/m/TY3PR01MB98892396D1071FC4320D6B31F586A@TY3PR01MB9889.jpnprd01.prod.outlook.com
-rw-r--r-- | src/bin/pg_upgrade/t/003_logical_slots.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/pg_upgrade/t/003_logical_slots.pl b/src/bin/pg_upgrade/t/003_logical_slots.pl index 087a4cd6e8f..020e7aa1cce 100644 --- a/src/bin/pg_upgrade/t/003_logical_slots.pl +++ b/src/bin/pg_upgrade/t/003_logical_slots.pl @@ -163,6 +163,12 @@ $sub->safe_psql( ]); $sub->wait_for_subscription_sync($oldpub, 'regress_sub'); +# Also wait for two-phase to be enabled +my $twophase_query = + "SELECT count(1) = 0 FROM pg_subscription WHERE subtwophasestate NOT IN ('e');"; +$sub->poll_query_until('postgres', $twophase_query) + or die "Timed out while waiting for subscriber to enable twophase"; + # 2. Temporarily disable the subscription $sub->safe_psql('postgres', "ALTER SUBSCRIPTION regress_sub DISABLE"); $oldpub->stop; |