diff options
author | Ian Boros <ian.boros@mongodb.com> | 2020-01-30 13:10:55 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-02-28 22:16:41 +0000 |
commit | cfa5c05fa1855fb1a04cb3a6e2eb10a7e82bf726 (patch) | |
tree | 7ab1e1ce8e2edd6837952c131fe14d43a0633235 /src/mongo/db/exec/delete.cpp | |
parent | 793ae32c597f197b6445750aa9bfdaabc206132d (diff) | |
download | mongo-cfa5c05fa1855fb1a04cb3a6e2eb10a7e82bf726.tar.gz |
SERVER-45406 Plumb ExpressionContext through PlanStage
This patch includes also moves ownership of the collator to the ExpressionContext.
Diffstat (limited to 'src/mongo/db/exec/delete.cpp')
-rw-r--r-- | src/mongo/db/exec/delete.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/mongo/db/exec/delete.cpp b/src/mongo/db/exec/delete.cpp index 4e5678defcc..4d9504a5b16 100644 --- a/src/mongo/db/exec/delete.cpp +++ b/src/mongo/db/exec/delete.cpp @@ -71,12 +71,12 @@ bool shouldRestartDeleteIfNoLongerMatches(const DeleteStageParams* params) { // static const char* DeleteStage::kStageType = "DELETE"; -DeleteStage::DeleteStage(OperationContext* opCtx, +DeleteStage::DeleteStage(ExpressionContext* expCtx, std::unique_ptr<DeleteStageParams> params, WorkingSet* ws, Collection* collection, PlanStage* child) - : RequiresMutableCollectionStage(kStageType, opCtx, collection), + : RequiresMutableCollectionStage(kStageType, expCtx, collection), _params(std::move(params)), _ws(ws), _idRetrying(WorkingSet::INVALID_ID), @@ -161,7 +161,7 @@ PlanStage::StageState DeleteStage::doWork(WorkingSetID* out) { bool docStillMatches; try { docStillMatches = write_stage_common::ensureStillMatches( - collection(), getOpCtx(), _ws, id, _params->canonicalQuery); + collection(), opCtx(), _ws, id, _params->canonicalQuery); } catch (const WriteConflictException&) { // There was a problem trying to detect if the document still exists, so retry. memberFreer.dismiss(); @@ -201,8 +201,8 @@ PlanStage::StageState DeleteStage::doWork(WorkingSetID* out) { // Do the write, unless this is an explain. if (!_params->isExplain) { try { - WriteUnitOfWork wunit(getOpCtx()); - collection()->deleteDocument(getOpCtx(), + WriteUnitOfWork wunit(opCtx()); + collection()->deleteDocument(opCtx(), _params->stmtId, recordId, _params->opDebug, @@ -261,8 +261,8 @@ void DeleteStage::doRestoreStateRequiresCollection() { const NamespaceString& ns = collection()->ns(); uassert(ErrorCodes::PrimarySteppedDown, str::stream() << "Demoted from primary while removing from " << ns.ns(), - !getOpCtx()->writesAreReplicated() || - repl::ReplicationCoordinator::get(getOpCtx())->canAcceptWritesFor(getOpCtx(), ns)); + !opCtx()->writesAreReplicated() || + repl::ReplicationCoordinator::get(opCtx())->canAcceptWritesFor(opCtx(), ns)); } unique_ptr<PlanStageStats> DeleteStage::getStats() { |