diff options
author | Samy Lanka <samy.lanka@mongodb.com> | 2021-02-16 23:14:28 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-16 23:57:45 +0000 |
commit | e5a1fe4a8ebd4cbc71c6f555ab08386d37a89736 (patch) | |
tree | 18f1339ffd22a73e6108f836718a4056c653c22b | |
parent | 408b94f30377eb038272903626c3acbf7b5cd3f7 (diff) | |
download | mongo-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.js | 7 |
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; |