diff options
author | Ali Mir <ali.mir@mongodb.com> | 2020-08-26 11:28:13 -0400 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-09-04 14:15:35 +0000 |
commit | 0c2f4ad0b12d4890ff4c7766641ddb2f9ec7cd63 (patch) | |
tree | 68f0b9dc0c19dbef0235688cb8cdfe7ba63cf948 /jstests/replsets/stepdown3.js | |
parent | 3f9e675017474fd53b6cc149ea492aed95b8c92d (diff) | |
download | mongo-0c2f4ad0b12d4890ff4c7766641ddb2f9ec7cd63.tar.gz |
SERVER-49993 Update _slaves to _secondaries in replsettest.js
Diffstat (limited to 'jstests/replsets/stepdown3.js')
-rw-r--r-- | jstests/replsets/stepdown3.js | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/jstests/replsets/stepdown3.js b/jstests/replsets/stepdown3.js index 5566e7379a1..53f8029908b 100644 --- a/jstests/replsets/stepdown3.js +++ b/jstests/replsets/stepdown3.js @@ -8,36 +8,36 @@ var replTest = new ReplSetTest({name: 'testSet', nodes: 2}); var nodes = replTest.startSet(); replTest.initiate(); -var master = replTest.getPrimary(); +var primary = replTest.getPrimary(); // do a write to allow stepping down of the primary; // otherwise, the primary will refuse to step down print("\ndo a write"); -master.getDB("test").foo.insert({x: 1}); +primary.getDB("test").foo.insert({x: 1}); replTest.awaitReplication(); // do another write, because the first one might be longer than 10 seconds ago // on the secondary (due to starting up), and we need to be within 10 seconds // to step down. var options = {writeConcern: {w: 2, wtimeout: 30000}}; -assert.commandWorked(master.getDB("test").foo.insert({x: 2}, options)); +assert.commandWorked(primary.getDB("test").foo.insert({x: 2}, options)); // lock secondary, to pause replication print("\nlock secondary"); -var locked = replTest._slaves[0]; +var locked = replTest.getSecondary(); printjson(locked.getDB("admin").runCommand({fsync: 1, lock: 1})); // do a write print("\ndo a write"); -master.getDB("test").foo.insert({x: 3}); +primary.getDB("test").foo.insert({x: 3}); // step down the primary asyncronously print("stepdown"); var command = "sleep(4000); assert.commandWorked(db.adminCommand( { replSetStepDown : 60, force : 1 } ));"; -var awaitShell = startParallelShell(command, master.port); +var awaitShell = startParallelShell(command, primary.port); print("getlasterror; should return an error"); -let result = master.getDB("test").runCommand({getLastError: 1, w: 2, wtimeout: 10 * 60 * 1000}); +let result = primary.getDB("test").runCommand({getLastError: 1, w: 2, wtimeout: 10 * 60 * 1000}); assert(ErrorCodes.isNotMasterError(result.code)); print("result of gle:"); printjson(result); |