summaryrefslogtreecommitdiff
path: root/src/mongo/s/query_analysis_sampler.cpp
diff options
context:
space:
mode:
authorIsrael Hsu <israel.hsu@mongodb.com>2023-03-20 15:39:05 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2023-03-20 16:35:20 +0000
commitb920e7b5b6628714e49e09ff5521182a68056915 (patch)
tree54ffad97a407f2134397c634f37303fdc174e4bd /src/mongo/s/query_analysis_sampler.cpp
parent67a1dd1b662b4273e969e4f2068c0dba2b9b8739 (diff)
downloadmongo-b920e7b5b6628714e49e09ff5521182a68056915.tar.gz
SERVER-74755 Make QueryAnalysisSampleCounters refresh config atomic with sampler refresh
Diffstat (limited to 'src/mongo/s/query_analysis_sampler.cpp')
-rw-r--r--src/mongo/s/query_analysis_sampler.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mongo/s/query_analysis_sampler.cpp b/src/mongo/s/query_analysis_sampler.cpp
index 23e8727fd77..a739bdf1787 100644
--- a/src/mongo/s/query_analysis_sampler.cpp
+++ b/src/mongo/s/query_analysis_sampler.cpp
@@ -277,8 +277,6 @@ void QueryAnalysisSampler::_refreshConfigurations(OperationContext* opCtx) {
"response"_attr = response);
}
- QueryAnalysisSampleCounters::get(opCtx).refreshConfigurations(response.getConfigurations());
-
stdx::lock_guard<Latch> lk(_mutex);
std::map<NamespaceString, SampleRateLimiter> sampleRateLimiters;
@@ -305,6 +303,8 @@ void QueryAnalysisSampler::_refreshConfigurations(OperationContext* opCtx) {
}
}
_sampleRateLimiters = std::move(sampleRateLimiters);
+
+ QueryAnalysisSampleCounters::get(opCtx).refreshConfigurations(response.getConfigurations());
}
void QueryAnalysisSampler::_incrementCounters(OperationContext* opCtx,