summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_entry_point_common.cpp
diff options
context:
space:
mode:
authorTess Avitabile <tess.avitabile@mongodb.com>2020-02-04 01:43:47 +0000
committerevergreen <evergreen@mongodb.com>2020-02-04 01:43:47 +0000
commite24494d6b1e4ebc2d5af1c0f1439b7cd4fc7e86d (patch)
treefef884e186a53742b55a146857c6c35de79f3248 /src/mongo/db/service_entry_point_common.cpp
parent25b0321d7954e9be920e7e5a053b81a54cac8a3c (diff)
downloadmongo-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.cpp12
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();