summaryrefslogtreecommitdiff
path: root/src/mongo/db/ttl.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2020-08-25 18:34:54 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-08-31 21:53:09 +0000
commitc70016c56f4f34ba09f4975fbf5bb3ac5129b5f7 (patch)
treec68f8e2c539246ef00a9abc4dfee16e667024dac /src/mongo/db/ttl.cpp
parent5360e4bd5724440676017d17f6878852753e4bac (diff)
downloadmongo-c70016c56f4f34ba09f4975fbf5bb3ac5129b5f7.tar.gz
SERVER-48477 move CRUD interface into PlanExecutor
This allows classic PlanStages to be removed from the PlanExecutor interface. It also positions the code base well for adding SBE support for all of the CRUD commands.
Diffstat (limited to 'src/mongo/db/ttl.cpp')
-rw-r--r--src/mongo/db/ttl.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index 126b9dcd0d3..f99a991da20 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -385,7 +385,9 @@ private:
direction);
try {
- exec->executePlan();
+ const auto numDeleted = exec->executeDelete();
+ ttlDeletedDocuments.increment(numDeleted);
+ LOGV2_DEBUG(22536, 1, "deleted: {numDeleted}", "numDeleted"_attr = numDeleted);
} catch (const ExceptionFor<ErrorCodes::QueryPlanKilled>&) {
// It is expected that a collection drop can kill a query plan while the TTL monitor is
// deleting an old document, so ignore this error.
@@ -398,10 +400,6 @@ private:
"error"_attr = redact(exception.toStatus()));
return;
}
-
- const long long numDeleted = DeleteStage::getNumDeleted(*exec);
- ttlDeletedDocuments.increment(numDeleted);
- LOGV2_DEBUG(22536, 1, "deleted: {numDeleted}", "numDeleted"_attr = numDeleted);
}
// Protects the state below.