diff options
author | Wenbin Zhu <wenbin.zhu@mongodb.com> | 2021-08-20 22:34:03 +0000 |
---|---|---|
committer | Wenbin Zhu <wenbin.zhu@mongodb.com> | 2021-08-26 21:39:58 +0000 |
commit | fa47f037feca94fd8385a15dd1fc3a23e648d880 (patch) | |
tree | 238bf3a95fe9b97150b8460fb91bde750974d0d2 | |
parent | ba6c7287e5ad13a65ef35e2468694219160775ce (diff) | |
download | mongo-fa47f037feca94fd8385a15dd1fc3a23e648d880.tar.gz |
SERVER-59478 Move serverStatus command before taking RSTL in catchup_takeover_with_higher_config.js.
(cherry picked from commit d9747e5fbfc820ca6ea9167d4361d83cd2f507c6)
-rw-r--r-- | jstests/replsets/catchup_takeover_with_higher_config.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/jstests/replsets/catchup_takeover_with_higher_config.js b/jstests/replsets/catchup_takeover_with_higher_config.js index 7cd885b599c..8995e456c50 100644 --- a/jstests/replsets/catchup_takeover_with_higher_config.js +++ b/jstests/replsets/catchup_takeover_with_higher_config.js @@ -54,6 +54,9 @@ replSet.initiateWithHighElectionTimeout(config); replSet.awaitReplication(); assert.eq(replSet.getPrimary(), nodes[0]); +const statusBeforeTakeover = + assert.commandWorked(nodes[1].adminCommand({serverStatus: 1, wiredTiger: 0})); + // Failpoint to hang node1 before the automatic reconfig on stepup bumps the config term. const hangBeforeTermBumpFpNode1 = configureFailPoint(nodes[1], "hangBeforeReconfigOnDrainComplete"); const initialConfig = assert.commandWorked(nodes[0].adminCommand({replSetGetConfig: 1})).config; @@ -90,8 +93,6 @@ assert.soon(() => { return status.syncSourceHost === nodes[2].host; }); -const statusBeforeTakeover = assert.commandWorked(nodes[1].adminCommand({serverStatus: 1})); - // Lift the failpoint on node1 to let it finish reconfig and bump the config term. hangBeforeTermBumpFpNode1.off(); @@ -117,7 +118,8 @@ hangBeforeTermBumpFpNode2.off(); replSet.awaitNodesAgreeOnPrimary(replSet.kDefaultTimeoutMS, nodes, nodes[1]); // Check that election metrics has been updated with the new reason counter. -const statusAfterTakeover = assert.commandWorked(nodes[1].adminCommand({serverStatus: 1})); +const statusAfterTakeover = + assert.commandWorked(nodes[1].adminCommand({serverStatus: 1, wiredTiger: 0})); verifyServerStatusElectionReasonCounterChange(statusBeforeTakeover.electionMetrics, statusAfterTakeover.electionMetrics, "catchUpTakeover", |