diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2018-02-05 17:21:06 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2018-02-08 10:31:50 -0500 |
commit | b730e13c75d21ee86fea0622a55410d790a23224 (patch) | |
tree | 5a2aeec9dce06a77fbd0070261b1b6eea17ed248 /src/mongo/db/query/plan_executor.cpp | |
parent | c556e377094792e7253a95cb5fedcd703a99bf2c (diff) | |
download | mongo-b730e13c75d21ee86fea0622a55410d790a23224.tar.gz |
SERVER-32685 Disable lock and WT transaction yielding under readConcern snapshot for find and getMore
Diffstat (limited to 'src/mongo/db/query/plan_executor.cpp')
-rw-r--r-- | src/mongo/db/query/plan_executor.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/db/query/plan_executor.cpp b/src/mongo/db/query/plan_executor.cpp index b2619986a46..b3ad1aa08d0 100644 --- a/src/mongo/db/query/plan_executor.cpp +++ b/src/mongo/db/query/plan_executor.cpp @@ -84,7 +84,8 @@ std::unique_ptr<PlanYieldPolicy> makeYieldPolicy(PlanExecutor* exec, case PlanExecutor::YieldPolicy::YIELD_AUTO: case PlanExecutor::YieldPolicy::YIELD_MANUAL: case PlanExecutor::YieldPolicy::NO_YIELD: - case PlanExecutor::YieldPolicy::WRITE_CONFLICT_RETRY_ONLY: { + case PlanExecutor::YieldPolicy::WRITE_CONFLICT_RETRY_ONLY: + case PlanExecutor::YieldPolicy::INTERRUPT_ONLY: { return stdx::make_unique<PlanYieldPolicy>(exec, policy); } case PlanExecutor::YieldPolicy::ALWAYS_TIME_OUT: { @@ -357,7 +358,7 @@ Status PlanExecutor::restoreState() { throw; // Handles retries by calling restoreStateWithoutRetrying() in a loop. - return _yieldPolicy->yield(); + return _yieldPolicy->yieldOrInterrupt(); } } @@ -469,7 +470,7 @@ PlanExecutor::ExecState PlanExecutor::waitForInserts(CappedInsertNotifierData* n ON_BLOCK_EXIT([curOp] { curOp->resumeTimer(); }); auto opCtx = _opCtx; uint64_t currentNotifierVersion = notifierData->notifier->getVersion(); - auto yieldResult = _yieldPolicy->yield(nullptr, [opCtx, notifierData] { + auto yieldResult = _yieldPolicy->yieldOrInterrupt(nullptr, [opCtx, notifierData] { const auto deadline = awaitDataState(opCtx).waitForInsertsDeadline; notifierData->notifier->waitUntil(notifierData->lastEOFVersion, deadline); }); @@ -537,8 +538,8 @@ PlanExecutor::ExecState PlanExecutor::getNextImpl(Snapshotted<BSONObj>* objOut, // 2) some stage requested a yield due to a document fetch, or // 3) we need to yield and retry due to a WriteConflictException. // In all cases, the actual yielding happens here. - if (_yieldPolicy->shouldYield()) { - auto yieldStatus = _yieldPolicy->yield(fetcher.get()); + if (_yieldPolicy->shouldYieldOrInterrupt()) { + auto yieldStatus = _yieldPolicy->yieldOrInterrupt(fetcher.get()); if (!yieldStatus.isOK()) { if (objOut) { *objOut = Snapshotted<BSONObj>( |