summaryrefslogtreecommitdiff
path: root/jstests
diff options
context:
space:
mode:
authorSiyuan Zhou <siyuan.zhou@mongodb.com>2017-04-10 18:21:22 -0400
committerSiyuan Zhou <siyuan.zhou@mongodb.com>2017-06-16 13:59:30 -0400
commit5cd646639e6f5e09a50c8c615cdcd2a0013a2bbb (patch)
tree79132f07be75788e2cad91350c2d04448061e453 /jstests
parent1b5e99525f78b0e88eac7dd8663d44d543195803 (diff)
downloadmongo-5cd646639e6f5e09a50c8c615cdcd2a0013a2bbb.tar.gz
SERVER-28751 Allow stepDown command to work against primary in catchup mode
(cherry picked from commit 52bb9f8492852f825de50467f66dd6e3e6b1b6a9)
Diffstat (limited to 'jstests')
-rw-r--r--jstests/replsets/catchup.js40
1 files changed, 19 insertions, 21 deletions
diff --git a/jstests/replsets/catchup.js b/jstests/replsets/catchup.js
index 93826d65c8a..fbcb0010274 100644
--- a/jstests/replsets/catchup.js
+++ b/jstests/replsets/catchup.js
@@ -180,26 +180,24 @@
rst.awaitReplication(ReplSetTest.kDefaultTimeoutMS, ReplSetTest.OpTimeType.LAST_DURABLE);
checkOpInOplog(stepUpResults.newPrimary, stepUpResults.latestOpOnOldPrimary, 0);
- // TODO: Uncomment case 6 when SERVER-28751 gets fixed.
- //
- // jsTest.log("Case 6: The primary needs to catch up with no timeout, but steps down.");
- // var stepUpResults = stopRelicationAndEnforceNewPrimaryToCatchUp();
-
- // // Step-down command should abort catchup.
- // try {
- // printjson(stepUpResults.newPrimary.adminCommand({replSetStepDown: 60}));
- // } catch (e) {
- // print(e);
- // }
- // // Rename the primary.
- // var steppedDownPrimary = stepUpResults.newPrimary;
- // var newPrimary = rst.getPrimary();
- // assert.neq(newPrimary, steppedDownPrimary);
-
- // // Enable data replication on the stepped down primary and make sure it syncs old writes.
- // rst.nodes.forEach(reconnect);
- // restartServerReplication(stepUpResults.oldSecondaries);
- // rst.awaitReplication(ReplSetTest.kDefaultTimeoutMS, ReplSetTest.OpTimeType.LAST_DURABLE);
- // checkOpInOplog(steppedDownPrimary, stepUpResults.latestOpOnOldPrimary, 1);
+ jsTest.log("Case 6: The primary needs to catch up with no timeout, but steps down.");
+ var stepUpResults = stopRelicationAndEnforceNewPrimaryToCatchUp();
+
+ // Step-down command should abort catchup.
+ try {
+ printjson(stepUpResults.newPrimary.adminCommand({replSetStepDown: 60}));
+ } catch (e) {
+ print(e);
+ }
+ // Rename the primary.
+ var steppedDownPrimary = stepUpResults.newPrimary;
+ var newPrimary = rst.getPrimary();
+ assert.neq(newPrimary, steppedDownPrimary);
+
+ // Enable data replication on the stepped down primary and make sure it syncs old writes.
+ rst.nodes.forEach(reconnect);
+ restartServerReplication(stepUpResults.oldSecondaries);
+ rst.awaitReplication(ReplSetTest.kDefaultTimeoutMS, ReplSetTest.OpTimeType.LAST_DURABLE);
+ checkOpInOplog(steppedDownPrimary, stepUpResults.latestOpOnOldPrimary, 1);
})();