diff options
author | James Wahlin <james@mongodb.com> | 2018-03-09 14:36:56 -0500 |
---|---|---|
committer | James Wahlin <james@mongodb.com> | 2018-03-20 14:07:58 -0400 |
commit | aaba5b468e67f81380f7fa099932a2722dab3a8a (patch) | |
tree | 26ed3e02b960230d1bc1c4ff17507e153b73354b /src/mongo/db/commands/parallel_collection_scan.cpp | |
parent | 3ef314d05280a5acfd84f3a8bb26e3bb9f31abde (diff) | |
download | mongo-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.cpp | 10 |
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; } |