From e13701a4f2eaffa894c4a718aaf5cc9e8ba97f71 Mon Sep 17 00:00:00 2001 From: Ryan Timmons Date: Tue, 14 Jan 2020 20:02:37 +0000 Subject: SERVER-45400 Reduce OplogFetcher getMore awaitData timeout for nodes in RollbackTest --- jstests/replsets/libs/rollback_test.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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 @@ -167,6 +167,20 @@ function RollbackTest(name = "RollbackTest", replSet) { {writeConcern: {w: 3}})); } + /** + * 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 -- cgit v1.2.1