diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2020-02-04 01:43:47 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2020-02-04 01:43:47 +0000 |
commit | e24494d6b1e4ebc2d5af1c0f1439b7cd4fc7e86d (patch) | |
tree | fef884e186a53742b55a146857c6c35de79f3248 /src/mongo/db/service_entry_point_common.cpp | |
parent | 25b0321d7954e9be920e7e5a053b81a54cac8a3c (diff) | |
download | mongo-e24494d6b1e4ebc2d5af1c0f1439b7cd4fc7e86d.tar.gz |
SERVER-45882 Do not attach topologyVersion to ShutdownErrors
Diffstat (limited to 'src/mongo/db/service_entry_point_common.cpp')
-rw-r--r-- | src/mongo/db/service_entry_point_common.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp index 05577a81323..621aebf5f77 100644 --- a/src/mongo/db/service_entry_point_common.cpp +++ b/src/mongo/db/service_entry_point_common.cpp @@ -442,20 +442,18 @@ void appendErrorLabelsAndTopologyVersion(OperationContext* opCtx, getErrorLabels(opCtx, sessionOptions, commandName, code, wcCode, isInternalClient); commandBodyFieldsBob->appendElements(errorLabels); - auto isStateChangeError = false; + auto isNotMasterError = false; if (code) { - isStateChangeError = ErrorCodes::isA<ErrorCategory::NotMasterError>(*code) || - ErrorCodes::isA<ErrorCategory::ShutdownError>(*code); + isNotMasterError = ErrorCodes::isA<ErrorCategory::NotMasterError>(*code); } - if (!isStateChangeError && wcCode) { - isStateChangeError = ErrorCodes::isA<ErrorCategory::NotMasterError>(*wcCode) || - ErrorCodes::isA<ErrorCategory::ShutdownError>(*wcCode); + if (!isNotMasterError && wcCode) { + isNotMasterError = ErrorCodes::isA<ErrorCategory::NotMasterError>(*wcCode); } const auto replCoord = repl::ReplicationCoordinator::get(opCtx); if (replCoord->getReplicationMode() != repl::ReplicationCoordinator::modeReplSet || - !isStateChangeError) { + !isNotMasterError) { return; } const auto topologyVersion = replCoord->getTopologyVersion(); |