summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavithra Vetriselvan <pavithra.vetriselvan@mongodb.com>2020-02-03 16:30:44 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-05-27 15:37:52 +0000
commit5abaf93b6088795ebf7c6822cd462e48a958805b (patch)
tree902c77e6a57605099b7c8ee83179c96839b21ed7
parentc48514d0417aa1832c0232bb9741a69fe28634dc (diff)
downloadmongo-5abaf93b6088795ebf7c6822cd462e48a958805b.tar.gz
SERVER-45919 replSetReconfig should be allowed to fail with InterruptedDueToReplStateChange in reconfig_during_election.js
(cherry picked from commit f44afc0ce5c5a0a8e7dacd2b0d3a042fc989a21d)
-rw-r--r--jstests/replsets/reconfig_during_election.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/jstests/replsets/reconfig_during_election.js b/jstests/replsets/reconfig_during_election.js
index b73303bd60d..3c36ef58adc 100644
--- a/jstests/replsets/reconfig_during_election.js
+++ b/jstests/replsets/reconfig_during_election.js
@@ -1,5 +1,6 @@
/**
- * SERVER-37255: replSetReconfig runs on a node that is concurrently processing an election win.
+ * SERVER-37255: replSetReconfig runs on a node that is concurrently processing an election win and
+ * does not result in an invariant.
*/
(function() {
@@ -42,7 +43,11 @@ jsTestLog("Try to interrupt it with a reconfig");
config.members[nodes.indexOf(candidate)].priority = 2;
config.version++;
-assert.commandWorked(candidate.adminCommand({replSetReconfig: config, force: true}));
+// While the candidate is stepping up, it it possible for the RstlKillOpThread to kill this reconfig
+// command before it succeeds. Failing with an InterruptedDueToReplStateChange error is acceptable
+// here because we are testing that the reconfig command does not cause the server to invariant.
+assert.commandWorkedOrFailedWithCode(candidate.adminCommand({replSetReconfig: config, force: true}),
+ ErrorCodes.InterruptedDueToReplStateChange);
assert.commandWorked(candidate.adminCommand(
{configureFailPoint: "electionHangsBeforeUpdateMemberState", mode: "off"}));