From 7c808909a8c0a746ffd2d8153c90a77be8b85204 Mon Sep 17 00:00:00 2001 From: Qingyang Chen Date: Thu, 6 Aug 2015 15:20:19 -0400 Subject: SERVER-19466 TTLMonitor::doTTLForIndex() use IXSCAN => FETCH => DELETE --- src/mongo/db/dbhelpers.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/mongo/db/dbhelpers.cpp') diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index b8e073e9b1d..0e854d70813 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -193,7 +193,8 @@ RecordId Helpers::findById(OperationContext* txn, Collection* collection, const bool Helpers::getSingleton(OperationContext* txn, const char* ns, BSONObj& result) { AutoGetCollectionForRead ctx(txn, ns); - unique_ptr exec(InternalPlanner::collectionScan(txn, ns, ctx.getCollection())); + unique_ptr exec( + InternalPlanner::collectionScan(txn, ns, ctx.getCollection(), PlanExecutor::YIELD_MANUAL)); PlanExecutor::ExecState state = exec->getNext(&result, NULL); CurOp::get(txn)->done(); @@ -208,7 +209,7 @@ bool Helpers::getSingleton(OperationContext* txn, const char* ns, BSONObj& resul bool Helpers::getLast(OperationContext* txn, const char* ns, BSONObj& result) { AutoGetCollectionForRead autoColl(txn, ns); unique_ptr exec(InternalPlanner::collectionScan( - txn, ns, autoColl.getCollection(), InternalPlanner::BACKWARD)); + txn, ns, autoColl.getCollection(), PlanExecutor::YIELD_MANUAL, InternalPlanner::BACKWARD)); PlanExecutor::ExecState state = exec->getNext(&result, NULL); if (PlanExecutor::ADVANCED == state) { @@ -353,6 +354,7 @@ long long Helpers::removeRange(OperationContext* txn, min, max, maxInclusive, + PlanExecutor::YIELD_MANUAL, InternalPlanner::FORWARD, InternalPlanner::IXSCAN_FETCH)); exec->setYieldPolicy(PlanExecutor::YIELD_AUTO); @@ -519,8 +521,13 @@ Status Helpers::getLocsInRange(OperationContext* txn, bool isLargeChunk = false; long long docCount = 0; - unique_ptr exec( - InternalPlanner::indexScan(txn, collection, idx, min, max, false)); + unique_ptr exec(InternalPlanner::indexScan(txn, + collection, + idx, + min, + max, + false, // endKeyInclusive + PlanExecutor::YIELD_MANUAL)); // we can afford to yield here because any change to the base data that we might miss is // already being queued and will be migrated in the 'transferMods' stage exec->setYieldPolicy(PlanExecutor::YIELD_AUTO); -- cgit v1.2.1