From b920e7b5b6628714e49e09ff5521182a68056915 Mon Sep 17 00:00:00 2001 From: Israel Hsu Date: Mon, 20 Mar 2023 15:39:05 +0000 Subject: SERVER-74755 Make QueryAnalysisSampleCounters refresh config atomic with sampler refresh --- src/mongo/s/query_analysis_sampler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mongo/s/query_analysis_sampler.cpp') 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 lk(_mutex); std::map 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, -- cgit v1.2.1