summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Schwerin <schwerin@mongodb.com>2014-10-28 13:58:21 -0400
committerAndy Schwerin <schwerin@mongodb.com>2014-10-28 15:51:21 -0400
commit9b06f0011e53cba1be7c5f123d2a9f9dd79ed4e6 (patch)
tree172ca2b261476217f09e7f0a50e249315bdb1f37
parent4752c4631525b7d26599fb89a0ae18784ebbcc73 (diff)
downloadmongo-9b06f0011e53cba1be7c5f123d2a9f9dd79ed4e6.tar.gz
SERVER-15836 Change how long we wait for the master in rollback4.js.
In the legacy implementation of replication, the newly elected node waits for queued oplog entries to drain before transitioning to primary. In the new implementation, it transitions immediately, but does not report "ismaster: true" until the drain completes.
-rw-r--r--jstests/slow2/rollback4.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/jstests/slow2/rollback4.js b/jstests/slow2/rollback4.js
index 977fa4661a4..3cb9d9bec00 100644
--- a/jstests/slow2/rollback4.js
+++ b/jstests/slow2/rollback4.js
@@ -40,8 +40,13 @@ replTest.stop( 0 );
// Wait for slave to take over
// This can take a while if the secondary has queued up many writes in its
// buffer, since it needs to flush those out before it can assume the primaryship.
+//
+// In the legacy replication implementation (through 2.7.7), this waiting takes place before the
+// node reports that it is primary, while in the refactored implementation (2.7.8+) it takes place
+// after the node reports that it is primary via heartbeats, but before ismaster indicates that the
+// node will accept writes.
replTest.waitForState(conns[1], replTest.PRIMARY, 5 * 60 * 1000);
-master = replTest.getMaster();
+master = replTest.getMaster(5 * 60 * 1000);
// Save to new master, forcing rollback of old master
master.getDB( 'db' ).c.save( big );