git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 16f96c7)
Make pg_rewind test case more stable.
2020年11月20日 14:08:58 +0000 (16:08 +0200)
2020年11月20日 14:11:52 +0000 (16:11 +0200)
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


diff --git a/src/bin/pg_rewind/t/007_standby_source.pl b/src/bin/pg_rewind/t/007_standby_source.pl
index f6abcc2d9872a9f04b067451825dcab0823c2ab8..7a597bf12bd7d178320a3acdbf0c4fc855c198ac 100644 (file)
--- 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',
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /