summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2021-06-08 12:12:04 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-06-17 15:20:59 +0000
commite0463ff305688f52db102f0cc605588e87daece4 (patch)
treec52df054fb72c19b3337160a86d47b1d05c04ac6
parenta3e5fc87c0da7da48acaac80ebbd7b46482cbdae (diff)
downloadmongo-e0463ff305688f52db102f0cc605588e87daece4.tar.gz
SERVER-55034 profile command takes intent locks when accessing profile settings
(cherry picked from commit 74fbf87121cd1d3c94dbaf5c4bed12456d2f1ccb)
-rw-r--r--src/mongo/db/commands/dbcommands_d.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mongo/db/commands/dbcommands_d.cpp b/src/mongo/db/commands/dbcommands_d.cpp
index 5a0b59584f6..0ba6c9618c1 100644
--- a/src/mongo/db/commands/dbcommands_d.cpp
+++ b/src/mongo/db/commands/dbcommands_d.cpp
@@ -166,7 +166,7 @@ protected:
// need to read the current filter, if any. If we're not changing either value, then we can
// acquire a shared lock instead of exclusive.
const bool readOnly = (profilingLevel < 0 || profilingLevel > 2) && !request.getFilter();
- const LockMode dbMode = readOnly ? MODE_S : MODE_X;
+ const LockMode dbMode = readOnly ? MODE_IS : MODE_IX;
// Accessing system.profile collection should not conflict with oplog application.
ShouldNotConflictWithSecondaryBatchApplicationBlock shouldNotConflictBlock(