summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Timmons <ryan.timmons@mongodb.com>2020-01-14 20:02:37 +0000
committerA. Jesse Jiryu Davis <jesse@mongodb.com>2020-01-27 15:40:33 -0500
commite13701a4f2eaffa894c4a718aaf5cc9e8ba97f71 (patch)
tree3a85ecc1c3ad345023d388e65d43af517432f9cb
parentdbc773d18d00c5343e78bb996769b202f62e5e4e (diff)
downloadmongo-e13701a4f2eaffa894c4a718aaf5cc9e8ba97f71.tar.gz
SERVER-45400 Reduce OplogFetcher getMore awaitData timeout for nodes in RollbackTest
-rw-r--r--jstests/replsets/libs/rollback_test.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/jstests/replsets/libs/rollback_test.js b/jstests/replsets/libs/rollback_test.js
index d9b4d8d9bff..97c97eaeda1 100644
--- a/jstests/replsets/libs/rollback_test.js
+++ b/jstests/replsets/libs/rollback_test.js
@@ -168,6 +168,20 @@ function RollbackTest(name = "RollbackTest", replSet) {
}
/**
+ * We set the election timeout to 24 hours to prevent unplanned elections, but this has the
+ * side-effect of causing `getMore` in replication to wait up 30 seconds prior to returning.
+ *
+ * The `setSmallOplogGetMoreMaxTimeMS` failpoint causes the `getMore` calls to block for a
+ * maximum of 50 milliseconds.
+ */
+ function setFastGetMoreEnabled(node) {
+ assert.commandWorked(
+ node.adminCommand(
+ {configureFailPoint: 'setSmallOplogGetMoreMaxTimeMS', mode: 'alwaysOn'}),
+ `Failed to enable setSmallOplogGetMoreMaxTimeMS failpoint.`);
+ }
+
+ /**
* Return an instance of ReplSetTest initialized with a standard
* three-node replica set running with the latest version.
*
@@ -186,6 +200,7 @@ function RollbackTest(name = "RollbackTest", replSet) {
let replSet = new ReplSetTest({name, nodes: 3, useBridge: true, nodeOptions: nodeOptions});
replSet.startSet();
+ replSet.nodes.forEach(setFastGetMoreEnabled);
let config = replSet.getReplSetConfig();
config.members[2].priority = 0;
@@ -522,6 +537,9 @@ function RollbackTest(name = "RollbackTest", replSet) {
log(`Restarting node ${hostName}`);
rst.start(nodeId, startOptions, true /* restart */);
+ // Fail-point will clear on restart so do post-start.
+ setFastGetMoreEnabled(rst.nodes[nodeId]);
+
// Step up if the restarted node is the current primary.
if (rst.getNodeId(curPrimary) === nodeId) {
// To prevent below step up from being flaky, we step down and freeze the