summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/parallel_collection_scan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/parallel_collection_scan.cpp')
-rw-r--r--src/mongo/db/commands/parallel_collection_scan.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp
index 5fbe37b1132..6b84996369c 100644
--- a/src/mongo/db/commands/parallel_collection_scan.cpp
+++ b/src/mongo/db/commands/parallel_collection_scan.cpp
@@ -89,9 +89,10 @@ public:
const string& dbname,
const BSONObj& cmdObj,
BSONObjBuilder& result) {
+ Lock::DBLock dbSLock(opCtx, dbname, MODE_IS);
const NamespaceString ns(parseNsOrUUID(opCtx, dbname, cmdObj));
- AutoGetCollectionForReadCommand ctx(opCtx, ns);
+ AutoGetCollectionForReadCommand ctx(opCtx, ns, std::move(dbSLock));
Collection* collection = ctx.getCollection();
if (!collection)