summaryrefslogtreecommitdiff
path: root/src/mongo/db/db_raii.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@10gen.com>2019-03-11 10:53:51 -0400
committerDavid Storch <david.storch@10gen.com>2019-03-11 16:45:05 -0400
commitb69c97b4da596f1da8dea2b40cf32a7c5c657870 (patch)
tree2768ececb87294c597ac488fd4aff36ce14541ee /src/mongo/db/db_raii.cpp
parent6f083bd87264e9d9c3d637fae62103c36a65316a (diff)
downloadmongo-b69c97b4da596f1da8dea2b40cf32a7c5c657870.tar.gz
SERVER-40058 Prevent AutoStatsTracker's db lock from conflicting with secondary batch application.
Diffstat (limited to 'src/mongo/db/db_raii.cpp')
-rw-r--r--src/mongo/db/db_raii.cpp5
1 files changed, 4 insertions, 1 deletions
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();