summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2020-05-22 12:24:49 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-05-26 15:52:25 +0000
commitb54c9c8f37783b8d8906988cd8c5f7625582f5cb (patch)
treeeab3c4ddfcc535aed9b19d0977623dee30bfc749
parent730dd3a6caf901f8b7013eae650bc75b3dd9c4ec (diff)
downloadmongo-b54c9c8f37783b8d8906988cd8c5f7625582f5cb.tar.gz
SERVER-48359 IndexBuildsCoordinatorMongod::_signalPrimaryForCommitReadiness() should not throw on remote shutdown error
(cherry picked from commit 935fce45d2074ad9bc68fb9c5b05ed73e5fdc186)
-rw-r--r--src/mongo/db/index_builds_coordinator_mongod.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/mongo/db/index_builds_coordinator_mongod.cpp b/src/mongo/db/index_builds_coordinator_mongod.cpp
index b535e5712ec..701392aec45 100644
--- a/src/mongo/db/index_builds_coordinator_mongod.cpp
+++ b/src/mongo/db/index_builds_coordinator_mongod.cpp
@@ -542,7 +542,8 @@ void IndexBuildsCoordinatorMongod::_signalPrimaryForCommitReadiness(
// or abort. This way, we can make sure majority of nodes will never stop voting and wait for
// commit or abort signal until they have received commit or abort signal.
while (needToVote()) {
- // check for any interrupts before starting the voting process.
+ // Check for any interrupts, including shutdown-related ones, before starting the voting
+ // process.
opCtx->checkForInterrupt();
// Don't hammer the network.
@@ -571,11 +572,7 @@ void IndexBuildsCoordinatorMongod::_signalPrimaryForCommitReadiness(
voteCmdResponse = replCoord->runCmdOnPrimaryAndAwaitResponse(
opCtx, "admin", voteCmdRequest, onRemoteCmdScheduled, onRemoteCmdComplete);
} catch (DBException& ex) {
- if (ex.isA<ErrorCategory::ShutdownError>()) {
- throw;
- }
-
- // All other errors including CallbackCanceled and network errors should be retried.
+ // All errors, including CallbackCanceled and network errors, should be retried.
// If ErrorCodes::CallbackCanceled is due to shutdown, then checkForInterrupt() at the
// beginning of this loop will catch it and throw an error to the caller. Or, if we
// received the CallbackCanceled error because the index build was signaled with abort