summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingzhi Deng <lingzhi.deng@mongodb.com>2022-02-15 15:04:11 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-03-14 01:43:42 +0000
commita3c66f9924423c48e13198ab96caf8e1d347851c (patch)
tree0e37aed84d0558cd215e595f335d2ea6544f69de
parent51e18f041ca20eaf4821241939ea5a0216be45bb (diff)
downloadmongo-a3c66f9924423c48e13198ab96caf8e1d347851c.tar.gz
SERVER-63471: waitForPrimaryOnlyServices finish rebuilding before testing stepDown in no_disconnect_on_stepdown.js
(cherry picked from commit a5d73b3c4b3680ed6cb34aaa90a0af33f1176846)
-rw-r--r--jstests/replsets/no_disconnect_on_stepdown.js18
1 files changed, 7 insertions, 11 deletions
diff --git a/jstests/replsets/no_disconnect_on_stepdown.js b/jstests/replsets/no_disconnect_on_stepdown.js
index 6d7e6036956..38b3998ae5f 100644
--- a/jstests/replsets/no_disconnect_on_stepdown.js
+++ b/jstests/replsets/no_disconnect_on_stepdown.js
@@ -7,17 +7,7 @@
load("jstests/libs/curop_helpers.js");
const rst = new ReplSetTest({
- nodes: [
- {
- // Each PrimaryOnlyService rebuilds its instances on stepup, and that may involve doing
- // read and write operations which are interruptible on stepdown so we need to disable
- // PrimaryOnlyService rebuild to make the userOperationsKilled check below work
- // reliably.
- setParameter:
- {"failpoint.PrimaryOnlyServiceSkipRebuildingInstances": tojson({mode: "alwaysOn"})}
- },
- {rsConfig: {priority: 0}}
- ],
+ nodes: [{}, {rsConfig: {priority: 0}}],
});
rst.startSet();
rst.initiate();
@@ -55,6 +45,12 @@ assert.commandWorked(primaryAdmin.adminCommand({replSetFreeze: 0}));
rst.getPrimary();
function runStepDownTest({description, failpoint, operation, errorCode}) {
+ const primary = rst.getPrimary();
+ // Each PrimaryOnlyService rebuilds its instances on stepup, and that may involve doing read and
+ // write operations which are interruptible on stepdown so we wait for PrimaryOnlyService to
+ // finish rebuilding to make the userOperationsKilled check below work reliably.
+ rst.waitForPrimaryOnlyServices(primary);
+
jsTestLog(`Trying ${description} on a stepping-down primary`);
assert.commandWorked(primaryAdmin.adminCommand({
configureFailPoint: failpoint,