diff options
Diffstat (limited to 'src/mongo/db/ops/delete_executor.cpp')
-rw-r--r-- | src/mongo/db/ops/delete_executor.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/mongo/db/ops/delete_executor.cpp b/src/mongo/db/ops/delete_executor.cpp index 8e39be7f7a1..aca3a86bb97 100644 --- a/src/mongo/db/ops/delete_executor.cpp +++ b/src/mongo/db/ops/delete_executor.cpp @@ -126,6 +126,16 @@ namespace mongo { str::stream() << "Not primary while removing from " << ns.ns()); } + // If yielding is allowed for this plan, then set an auto yield policy. Otherwise set + // a manual yield policy. + const bool canYield = !_request->isGod() && ( + _canonicalQuery.get() ? + !QueryPlannerCommon::hasNode(_canonicalQuery->root(), MatchExpression::ATOMIC) : + !LiteParsedQuery::isQueryIsolated(_request->getQuery())); + + PlanExecutor::YieldPolicy policy = canYield ? PlanExecutor::YIELD_AUTO : + PlanExecutor::YIELD_MANUAL; + PlanExecutor* rawExec; Status getExecStatus = Status::OK(); if (_canonicalQuery.get()) { @@ -137,6 +147,7 @@ namespace mongo { _request->shouldCallLogOp(), _request->isFromMigrate(), _request->isExplain(), + policy, &rawExec); } else { @@ -149,6 +160,7 @@ namespace mongo { _request->shouldCallLogOp(), _request->isFromMigrate(), _request->isExplain(), + policy, &rawExec); } @@ -159,18 +171,6 @@ namespace mongo { invariant(rawExec); _exec.reset(rawExec); - // If yielding is allowed for this plan, then set an auto yield policy. Otherwise set - // a manual yield policy. - const bool canYield = !_request->isGod() && ( - _canonicalQuery.get() ? - !QueryPlannerCommon::hasNode(_canonicalQuery->root(), MatchExpression::ATOMIC) : - !LiteParsedQuery::isQueryIsolated(_request->getQuery())); - - PlanExecutor::YieldPolicy policy = canYield ? PlanExecutor::YIELD_AUTO : - PlanExecutor::YIELD_MANUAL; - - _exec->setYieldPolicy(policy); - return Status::OK(); } |