From e5a1fe4a8ebd4cbc71c6f555ab08386d37a89736 Mon Sep 17 00:00:00 2001 From: Samy Lanka Date: Tue, 16 Feb 2021 23:14:28 +0000 Subject: SERVER-54540 Allow for network errors when restarting heartbeats to induce rollback in rollback test fixture --- jstests/replsets/libs/rollback_test.js | 7 +++++-- 1 file 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; -- cgit v1.2.1