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-02-15 17:08:22 +0000
commita5d73b3c4b3680ed6cb34aaa90a0af33f1176846 (patch)
tree002288fe3d61cb97e3eaf1bed1c769d804204321
parenta5705b89f02a4cc1c3b1ce0eebc11e53fe668c5b (diff)
downloadmongo-a5d73b3c4b3680ed6cb34aaa90a0af33f1176846.tar.gz
SERVER-63471: waitForPrimaryOnlyServices finish rebuilding before testing stepDown in no_disconnect_on_stepdown.js
-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 dc84e254ae7..6d5162201e7 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();
@@ -52,6 +42,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,