summaryrefslogtreecommitdiff
path: root/src/mongo/db/service_entry_point_common.cpp
diff options
context:
space:
mode:
authorBrett Nawrocki <brett.nawrocki@mongodb.com>2022-09-02 21:22:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-09-16 15:35:10 +0000
commit2514cb0721a0df59601f3ff264a9a03d5015db71 (patch)
treedfc13fbbdc541acba28a93618bf50808d5449d0f /src/mongo/db/service_entry_point_common.cpp
parent8e990303de72e04600770082e41aec92f6221c8b (diff)
downloadmongo-2514cb0721a0df59601f3ff264a9a03d5015db71.tar.gz
SERVER-68932 Fix resharding critical section metrics
Diffstat (limited to 'src/mongo/db/service_entry_point_common.cpp')
-rw-r--r--src/mongo/db/service_entry_point_common.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mongo/db/service_entry_point_common.cpp b/src/mongo/db/service_entry_point_common.cpp
index 1033abb70e0..ac6955774f3 100644
--- a/src/mongo/db/service_entry_point_common.cpp
+++ b/src/mongo/db/service_entry_point_common.cpp
@@ -1828,8 +1828,8 @@ Future<void> ExecCommandDatabase::_commandExec() {
serverGlobalParams.clusterRole != ClusterRole::ConfigServer &&
!_refreshedCollection) {
if (auto sce = s.extraInfo<StaleConfigInfo>()) {
- bool stableLocalVersion =
- !sce->getCriticalSectionSignal() && sce->getVersionWanted();
+ bool inCriticalSection = sce->getCriticalSectionSignal().has_value();
+ bool stableLocalVersion = !inCriticalSection && sce->getVersionWanted();
if (stableLocalVersion &&
ChunkVersion::isIgnoredVersion(sce->getVersionReceived())) {
@@ -1845,7 +1845,7 @@ Future<void> ExecCommandDatabase::_commandExec() {
return s;
}
- if (sce->getCriticalSectionSignal()) {
+ if (inCriticalSection) {
_execContext->behaviors->handleReshardingCriticalSectionMetrics(opCtx,
*sce);
}
@@ -1853,8 +1853,7 @@ Future<void> ExecCommandDatabase::_commandExec() {
const auto refreshed = _execContext->behaviors->refreshCollection(opCtx, *sce);
if (refreshed) {
_refreshedCollection = true;
- if (!opCtx->isContinuingMultiDocumentTransaction() &&
- !sce->getCriticalSectionSignal()) {
+ if (!opCtx->isContinuingMultiDocumentTransaction() && !inCriticalSection) {
_resetLockerStateAfterShardingUpdate(opCtx);
return _commandExec();
}