summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/parallel_collection_scan.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james@mongodb.com>2018-03-09 14:36:56 -0500
committerJames Wahlin <james@mongodb.com>2018-03-20 14:07:58 -0400
commitaaba5b468e67f81380f7fa099932a2722dab3a8a (patch)
tree26ed3e02b960230d1bc1c4ff17507e153b73354b /src/mongo/db/commands/parallel_collection_scan.cpp
parent3ef314d05280a5acfd84f3a8bb26e3bb9f31abde (diff)
downloadmongo-aaba5b468e67f81380f7fa099932a2722dab3a8a.tar.gz
SERVER-33354 Add snapshot read support for additional commands
Diffstat (limited to 'src/mongo/db/commands/parallel_collection_scan.cpp')
-rw-r--r--src/mongo/db/commands/parallel_collection_scan.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/mongo/db/commands/parallel_collection_scan.cpp b/src/mongo/db/commands/parallel_collection_scan.cpp
index c040e9e0510..ae3818ab9ea 100644
--- a/src/mongo/db/commands/parallel_collection_scan.cpp
+++ b/src/mongo/db/commands/parallel_collection_scan.cpp
@@ -129,8 +129,15 @@ public:
make_unique<MultiIteratorStage>(opCtx, ws.get(), collection);
// Takes ownership of 'ws' and 'mis'.
+ const auto& readConcernArgs = repl::ReadConcernArgs::get(opCtx);
auto statusWithPlanExecutor = PlanExecutor::make(
- opCtx, std::move(ws), std::move(mis), collection, PlanExecutor::YIELD_AUTO);
+ opCtx,
+ std::move(ws),
+ std::move(mis),
+ collection,
+ readConcernArgs.getLevel() == repl::ReadConcernLevel::kSnapshotReadConcern
+ ? PlanExecutor::INTERRUPT_ONLY
+ : PlanExecutor::YIELD_AUTO);
invariant(statusWithPlanExecutor.isOK());
execs.push_back(std::move(statusWithPlanExecutor.getValue()));
}
@@ -167,6 +174,7 @@ public:
bucketsBuilder.append(threadResult.obj());
}
result.appendArray("cursors", bucketsBuilder.obj());
+ opCtx->setStashedCursor();
return true;
}