summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2018-04-17 14:37:17 -0400
committerBenety Goh <benety@mongodb.com>2018-04-17 14:37:34 -0400
commit91fc5673cab5d1267fd805f1375577df9072ea1b (patch)
treee7b1f37bbbd29567dd0a5809d8f7500c0c6b7c48
parent88385c06825a73a3875bcdecf2af650c012b48f1 (diff)
downloadmongo-r3.7.5.tar.gz
SERVER-33812 remove rollback_too_new.jsr3.7.5
roll_back_local_operations_test provides coverage for this error condition.
-rw-r--r--jstests/replsets/rollback_too_new.js78
1 files changed, 0 insertions, 78 deletions
diff --git a/jstests/replsets/rollback_too_new.js b/jstests/replsets/rollback_too_new.js
deleted file mode 100644
index cb86a706c3d..00000000000
--- a/jstests/replsets/rollback_too_new.js
+++ /dev/null
@@ -1,78 +0,0 @@
-// test that a rollback of an op more than 1800 secs newer than the new master causes fatal shutdown
-//
-// If all data-bearing nodes in a replica set are using an ephemeral storage engine, the set will
-// not be able to survive a scenario where all data-bearing nodes are down simultaneously. In such a
-// scenario, none of the members will have any data, and upon restart will each look for a member to
-// inital sync from, so no primary will be elected. This test induces such a scenario, so cannot be
-// run on ephemeral storage engines.
-// @tags: [requires_persistence]
-
-(function() {
- "use strict";
- load("jstests/replsets/rslib.js"); // For getLatestOp()
-
- // set up a set and grab things for later
- var name = "rollback_too_new";
- var replTest = new ReplSetTest({name: name, nodes: 3});
- var nodes = replTest.nodeList();
- var conns = replTest.startSet();
- replTest.initiate({
- "_id": name,
- "members": [
- {"_id": 0, "host": nodes[0]},
- {"_id": 1, "host": nodes[1], arbiterOnly: true},
- {"_id": 2, "host": nodes[2], priority: 0}
- ],
- "settings": {"chainingAllowed": false}
- });
- var c_conn = conns[2];
- var CID = replTest.getNodeId(c_conn);
-
- // get master and do an initial write
- var master = replTest.getPrimary();
- var options = {writeConcern: {w: 2, wtimeout: ReplSetTest.kDefaultTimeoutMS}};
- assert.writeOK(master.getDB(name).foo.insert({x: 1}, options));
-
- // add an oplog entry from the distant future as the most recent entry on node C
- var future_oplog_entry = conns[2].getDB("local").oplog.rs.find().sort({$natural: -1})[0];
- future_oplog_entry["ts"] = new Timestamp(future_oplog_entry["ts"].getTime() + 1, 1);
- future_oplog_entry["wall"] = new Date(Date.now() + (5000 * 1000));
-
- options = {writeConcern: {w: 1, wtimeout: ReplSetTest.kDefaultTimeoutMS}};
- assert.writeOK(conns[2].getDB("local").oplog.rs.insert(future_oplog_entry, options));
-
- replTest.stop(CID);
-
- // We bump the term to make sure node 0's oplog is ahead of node 2's.
- var term = getLatestOp(conns[0]).t;
- assert.adminCommandWorkedAllowingNetworkError(conns[0], {replSetStepDown: 1, force: true});
-
- // After stepping down due to the higher term, it will eventually get reelected.
- replTest.waitForState(conns[0], ReplSetTest.State.PRIMARY);
- // Wait for the node to increase its term.
- assert.soon(function() {
- return getLatestOp(conns[0]).t > term;
- });
-
- // Node C should connect to new master as a sync source because chaining is disallowed.
- // C is ahead of master but it will still connect to it.
- clearRawMongoProgramOutput();
- c_conn = replTest.start(CID, {waitForConnect: true}, true /*restart*/);
-
- // Wait for node C to fassert
- assert.soon(function() {
- try {
- c_conn.getDB("local").runCommand({ping: 1});
- } catch (e) {
- return true;
- }
- return false;
- }, "Node did not fassert", 60 * 1000);
-
- replTest.stop(CID, undefined, {allowedExitCode: MongoRunner.EXIT_ABRUPT});
-
- assert(rawMongoProgramOutput().match("not willing to roll back more than 1800 seconds of data"),
- "node C failed to fassert");
-
- replTest.stopSet();
-}());