Skip to content

Commit

Permalink
SERVER-13839 circumvent reconfig in sync2.js
Browse files Browse the repository at this point in the history
  • Loading branch information
matt dannenberg committed May 6, 2014
1 parent db2cdad commit 0779e3a
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions jstests/replsets/sync2.js
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
var replTest = new ReplSetTest({name: 'sync2', nodes: 5});
var nodes = replTest.nodeList();
replTest.startSet({oplogSize: "2"});
replTest.initiate({"_id": "sync2",
"members": [
{"_id": 0, host: nodes[0], priority: 2},
{"_id": 1, host: nodes[1]},
{"_id": 2, host: nodes[2]},
{"_id": 3, host: nodes[3]},
{"_id": 4, host: nodes[4]}]
});

var replTest = new ReplSetTest({ name: 'testSet', nodes: 5 });
var nodes = replTest.startSet({ oplogSize: "2" });
replTest.initiate();

jsTestLog("Replica set test initialized, reconfiguring to give one node higher priority");
var master = replTest.getMaster();
var config = master.getDB("local").system.replset.findOne();
config.version++;
config.members[0].priority = 2;

try {
master.getDB("admin").runCommand({replSetReconfig : config});
}
catch(e) {
print(e);
}

replTest.awaitSecondaryNodes();
jsTestLog("Replica set test initialized");

// initial sync
master.getDB("foo").bar.insert({x:1});
replTest.awaitReplication();
Expand Down

0 comments on commit 0779e3a

Please sign in to comment.