summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamy Lanka <samy.lanka@mongodb.com>2021-02-16 23:14:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-16 23:57:45 +0000
commite5a1fe4a8ebd4cbc71c6f555ab08386d37a89736 (patch)
tree18f1339ffd22a73e6108f836718a4056c653c22b
parent408b94f30377eb038272903626c3acbf7b5cd3f7 (diff)
downloadmongo-e5a1fe4a8ebd4cbc71c6f555ab08386d37a89736.tar.gz
SERVER-54540 Allow for network errors when restarting heartbeats to induce rollback in rollback test fixture
-rw-r--r--jstests/replsets/libs/rollback_test.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/jstests/replsets/libs/rollback_test.js b/jstests/replsets/libs/rollback_test.js
index 812fbf9d7a6..227947cea1a 100644
--- a/jstests/replsets/libs/rollback_test.js
+++ b/jstests/replsets/libs/rollback_test.js
@@ -528,9 +528,12 @@ function RollbackTest(name = "RollbackTest", replSet) {
// Reconnect the rollback node to the current primary, which is the node we want to sync
// from. If we reconnect to both the current primary and the tiebreaker node, the rollback
// node may choose the tiebreaker. Send out a new round of heartbeats immediately so that
- // the rollback node can find a sync source quickly.
+ // the rollback node can find a sync source quickly. If there was a network error when
+ // trying to send out a new round of heartbeats, that indicates that rollback was already
+ // in progress and had closed connections, so there's no need to retry the command.
curSecondary.reconnect([curPrimary]);
- assert.commandWorked(curSecondary.adminCommand({replSetTest: 1, restartHeartbeats: 1}));
+ assert.adminCommandWorkedAllowingNetworkError(curSecondary,
+ {replSetTest: 1, restartHeartbeats: 1});
log(`RollbackTest transition to ${curState} took ${(new Date() - start)} ms`);
return curPrimary;