diff options
author | Eric Milkie <milkie@10gen.com> | 2016-04-20 11:35:06 -0400 |
---|---|---|
committer | Eric Milkie <milkie@10gen.com> | 2016-04-20 13:10:37 -0400 |
commit | 5dd37d3fa197e73fab8298e5d748e06393b053b2 (patch) | |
tree | df238dcdb6c8a02724b353db7c6fe69258422340 /jstests/slow1 | |
parent | a5e194f149be57ab7eb4bfc2b96bcbdd5682ee43 (diff) | |
download | mongo-5dd37d3fa197e73fab8298e5d748e06393b053b2.tar.gz |
SERVER-23828 replsets_priority1.js: wait for replication after election but before shutting down
Diffstat (limited to 'jstests/slow1')
-rw-r--r-- | jstests/slow1/replsets_priority1.js | 9 |
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"); |