summaryrefslogtreecommitdiff
path: root/jstests/replsets/stepup.js
diff options
context:
space:
mode:
authorJonathan Abrahams <jonathan@mongodb.com>2016-07-06 09:08:05 -0400
committerJonathan Abrahams <jonathan@mongodb.com>2016-07-06 09:08:05 -0400
commit05eca76c9df7df37cb422aa385cd4f121578b381 (patch)
tree51d84bc9088da3f73322373f817255ea86b273ed /jstests/replsets/stepup.js
parent063e0ca406ada731a0814b7503e1da95a21ab1d8 (diff)
downloadmongo-05eca76c9df7df37cb422aa385cd4f121578b381.tar.gz
Revert "SERVER-24881 Add StepUp Command."
This reverts commit e3ee305be314d8109ec1f1fd558b7011817dbfe7.
Diffstat (limited to 'jstests/replsets/stepup.js')
-rw-r--r--jstests/replsets/stepup.js53
1 files changed, 0 insertions, 53 deletions
diff --git a/jstests/replsets/stepup.js b/jstests/replsets/stepup.js
deleted file mode 100644
index f772febfe50..00000000000
--- a/jstests/replsets/stepup.js
+++ /dev/null
@@ -1,53 +0,0 @@
-// Tests the replSetStepUp command.
-
-load("jstests/replsets/rslib.js");
-
-(function() {
-
- "use strict";
- var name = "stepup";
- var rst = new ReplSetTest({name: name, nodes: 2});
-
- rst.startSet();
- // Initiate the replset in protocol version 0.
- var conf = rst.getReplSetConfig();
- conf.protocolVersion = 0;
- rst.initiate(conf);
- rst.awaitReplication();
-
- var primary = rst.getPrimary();
- var secondary = rst.getSecondary();
- var res = secondary.adminCommand({replSetStepUp: 1});
- assert.commandFailedWithCode(res, ErrorCodes.CommandNotSupported);
-
- // Upgrade protocol version
- conf = rst.getReplSetConfigFromNode();
- conf.protocolVersion = 1;
- conf.version++;
- reconfig(rst, conf);
- // Wait for the upgrade to finish.
- assert.writeOK(primary.getDB("test").bar.insert({x: 1}, {writeConcern: {w: 2}}));
-
- // Step up the primary. Return OK because it's already the primary.
- res = primary.adminCommand({replSetStepUp: 1});
- assert.commandWorked(res);
- assert.eq(primary, rst.getPrimary());
-
- // Step up the secondary, but it's not eligible to be primary.
- // Enable fail point on secondary.
- assert.commandWorked(secondary.getDB('admin').runCommand(
- {configureFailPoint: 'rsSyncApplyStop', mode: 'alwaysOn'}));
-
- assert.writeOK(primary.getDB("test").bar.insert({x: 2}, {writeConcern: {w: 1}}));
- res = secondary.adminCommand({replSetStepUp: 1});
- assert.commandFailedWithCode(res, ErrorCodes.NotMaster);
- assert.commandWorked(
- secondary.getDB('admin').runCommand({configureFailPoint: 'rsSyncApplyStop', mode: 'off'}));
-
- // Step up the secondary and succeed.
- rst.awaitReplication();
- res = secondary.adminCommand({replSetStepUp: 1});
- assert.commandWorked(res);
- assert.eq(secondary, rst.getPrimary());
-
-})();