summaryrefslogtreecommitdiff
path: root/src/mongo/db/dbhelpers.cpp
diff options
context:
space:
mode:
authorQingyang Chen <qingyang.chen@10gen.com>2015-08-06 15:20:19 -0400
committerQingyang Chen <qingyang.chen@10gen.com>2015-08-13 14:18:55 -0400
commit7c808909a8c0a746ffd2d8153c90a77be8b85204 (patch)
tree988b67fed5c71f6906a6e7852688576a456fdf6d /src/mongo/db/dbhelpers.cpp
parent9eadefd1f5e9f9a480f14fe5ad0b1b1838e96005 (diff)
downloadmongo-7c808909a8c0a746ffd2d8153c90a77be8b85204.tar.gz
SERVER-19466 TTLMonitor::doTTLForIndex() use IXSCAN => FETCH => DELETE
Diffstat (limited to 'src/mongo/db/dbhelpers.cpp')
-rw-r--r--src/mongo/db/dbhelpers.cpp15
1 files changed, 11 insertions, 4 deletions
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<PlanExecutor> exec(InternalPlanner::collectionScan(txn, ns, ctx.getCollection()));
+ unique_ptr<PlanExecutor> 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<PlanExecutor> 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<PlanExecutor> exec(
- InternalPlanner::indexScan(txn, collection, idx, min, max, false));
+ unique_ptr<PlanExecutor> 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);