diff options
author | Brett Nawrocki <brett.nawrocki@mongodb.com> | 2022-09-02 21:22:15 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-09-16 15:35:10 +0000 |
commit | 2514cb0721a0df59601f3ff264a9a03d5015db71 (patch) | |
tree | dfc13fbbdc541acba28a93618bf50808d5449d0f /src/mongo/db/service_entry_point_common.cpp | |
parent | 8e990303de72e04600770082e41aec92f6221c8b (diff) | |
download | mongo-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.cpp | 9 |
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(); } |