From b69c97b4da596f1da8dea2b40cf32a7c5c657870 Mon Sep 17 00:00:00 2001 From: David Storch Date: Mon, 11 Mar 2019 10:53:51 -0400 Subject: SERVER-40058 Prevent AutoStatsTracker's db lock from conflicting with secondary batch application. --- src/mongo/db/db_raii.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mongo/db/db_raii.cpp b/src/mongo/db/db_raii.cpp index baa855f8059..cf87b7be354 100644 --- a/src/mongo/db/db_raii.cpp +++ b/src/mongo/db/db_raii.cpp @@ -58,7 +58,10 @@ AutoStatsTracker::AutoStatsTracker(OperationContext* opCtx, : _opCtx(opCtx), _lockType(lockType), _nss(nss) { if (!dbProfilingLevel && logMode == LogMode::kUpdateTopAndCurop) { // No profiling level was determined, attempt to read the profiling level from the Database - // object. + // object. Since we are only reading the in-memory profiling level out of the database + // object (which is configured on a per-node basis and not replicated or persisted), we + // never need to conflict with secondary batch application. + ShouldNotConflictWithSecondaryBatchApplicationBlock noConflict(opCtx->lockState()); AutoGetDb autoDb(_opCtx, _nss.db(), MODE_IS, deadline); if (autoDb.getDb()) { dbProfilingLevel = autoDb.getDb()->getProfilingLevel(); -- cgit v1.2.1