aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-11-20 16:08:58 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2020-11-20 16:11:52 +0200
commitc71f9a094b32770dcd34b9ba4909435e34583747 (patch)
tree8c4af75f429cd5a3f9f8515092f73cbce111cbd1 /src
parent16f96c74d48e65da23d28665103e2c4c9d3414cc (diff)
downloadpostgresql-c71f9a094b32770dcd34b9ba4909435e34583747.tar.gz
postgresql-c71f9a094b32770dcd34b9ba4909435e34583747.zip
Make pg_rewind test case more stable.
If replication is exceptionally slow for some reason, pg_rewind might run before the test row has been replicated. Add an explicit wait for it. Reported-by: Andres Freund Discussion: https://www.postgresql.org/message-id/20201120003811.iknhqwatitw2vvxf%40alap3.anarazel.de
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_rewind/t/007_standby_source.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/bin/pg_rewind/t/007_standby_source.pl b/src/bin/pg_rewind/t/007_standby_source.pl
index f6abcc2d987..7a597bf12bd 100644
--- a/src/bin/pg_rewind/t/007_standby_source.pl
+++ b/src/bin/pg_rewind/t/007_standby_source.pl
@@ -89,6 +89,10 @@ $node_c->safe_psql('postgres', "checkpoint");
$node_a->safe_psql('postgres',
"INSERT INTO tbl1 VALUES ('in A, after C was promoted')");
+# make sure it's replicated to B before we continue
+$lsn = $node_a->lsn('insert');
+$node_a->wait_for_catchup('node_b', 'replay', $lsn);
+
# Also insert a new row in the standby, which won't be present in the
# old primary.
$node_c->safe_psql('postgres',