summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorEric Milkie <milkie@10gen.com>2016-04-20 11:35:06 -0400
committerEric Milkie <milkie@10gen.com>2016-04-20 13:11:07 -0400
commit572b3b9673cb7ed5e033ff6c43019ba701c926ee (patch)
tree29e86255e18434cd55cdfaf47c0764939ab43123 /jstests
parent111b51db9db315b6ed0fcfc8f444c75c85f54dc6 (diff)
downloadmongo-572b3b9673cb7ed5e033ff6c43019ba701c926ee.tar.gz
SERVER-23828 replsets_priority1.js: wait for replication after election but before shutting down
(cherry picked from commit 5dd37d3fa197e73fab8298e5d748e06393b053b2)
Diffstat (limited to 'jstests')
-rw-r--r--jstests/slow1/replsets_priority1.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/jstests/slow1/replsets_priority1.js b/jstests/slow1/replsets_priority1.js
index 098af758bdd..7e5d562214b 100644
--- a/jstests/slow1/replsets_priority1.js
+++ b/jstests/slow1/replsets_priority1.js
@@ -171,6 +171,9 @@ for (i = 0; i < n; i++) {
checkPrimaryIs(max);
+ // Wait for election oplog entry to be replicated, to avoid rollbacks later on.
+ rs.awaitReplication();
+
print("rs.stop");
rs.stop(max._id);
@@ -182,6 +185,9 @@ for (i = 0; i < n; i++) {
print("second is " + second.host + " with priority " + second.priority);
checkPrimaryIs(second);
+ // Wait for election oplog entry to be replicated, to avoid rollbacks later on.
+ rs.awaitReplication();
+
print("restart max " + max._id);
rs.restart(max._id);
@@ -189,6 +195,9 @@ for (i = 0; i < n; i++) {
print("max restarted. Checking statuses.");
checkPrimaryIs(max);
+
+ // Wait for election oplog entry to be replicated, to avoid rollbacks later on.
+ rs.awaitReplication();
}
print("\n\n\n\n\nreplsets_priority1.js SUCCESS!\n\n");