From bcab0c7e1c1b2e1516d06d23233fea9a425b99f7 Mon Sep 17 00:00:00 2001 From: Henrik Edin Date: Wed, 30 Sep 2020 11:19:31 -0400 Subject: SERVER-51200 CollectionPtr in RequiresCollectionStage point to instance owned by AutoGetCollection RequiresCollectionStage now holds a pointer to CollectionPtr owned by an AutoGetCollection. When we save and restore the executor a new CollectionPtr pointer needs to be assigned. Plan executors can no longer be created with temporary CollectionPtr instances and their interface have been changed to take pointers to avoid binding to rvalues. RequiresCollectionStage no longer loads collections from the catalog and will be in sync with the owning AutoGetCollection. --- src/mongo/db/ops/delete.cpp | 2 +- src/mongo/db/ops/update.cpp | 2 +- src/mongo/db/ops/write_ops_exec.cpp | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mongo/db/ops') diff --git a/src/mongo/db/ops/delete.cpp b/src/mongo/db/ops/delete.cpp index a546a57ea76..5bc4f83b19b 100644 --- a/src/mongo/db/ops/delete.cpp +++ b/src/mongo/db/ops/delete.cpp @@ -58,7 +58,7 @@ long long deleteObjects(OperationContext* opCtx, uassertStatusOK(parsedDelete.parseRequest()); auto exec = uassertStatusOK(getExecutorDelete( - &CurOp::get(opCtx)->debug(), collection, &parsedDelete, boost::none /* verbosity */)); + &CurOp::get(opCtx)->debug(), &collection, &parsedDelete, boost::none /* verbosity */)); return exec->executeDelete(); } diff --git a/src/mongo/db/ops/update.cpp b/src/mongo/db/ops/update.cpp index 899dbac9713..455afeadbf9 100644 --- a/src/mongo/db/ops/update.cpp +++ b/src/mongo/db/ops/update.cpp @@ -93,7 +93,7 @@ UpdateResult update(OperationContext* opCtx, Database* db, const UpdateRequest& OpDebug* const nullOpDebug = nullptr; auto exec = uassertStatusOK( - getExecutorUpdate(nullOpDebug, collection, &parsedUpdate, boost::none /* verbosity */)); + getExecutorUpdate(nullOpDebug, &collection, &parsedUpdate, boost::none /* verbosity */)); return exec->executeUpdate(); } diff --git a/src/mongo/db/ops/write_ops_exec.cpp b/src/mongo/db/ops/write_ops_exec.cpp index 981f1a542a4..22d6c9e29cb 100644 --- a/src/mongo/db/ops/write_ops_exec.cpp +++ b/src/mongo/db/ops/write_ops_exec.cpp @@ -666,7 +666,7 @@ static SingleWriteResult performSingleUpdateOp(OperationContext* opCtx, assertCanWrite_inlock(opCtx, ns); auto exec = uassertStatusOK(getExecutorUpdate( - &curOp.debug(), collection->getCollection(), &parsedUpdate, boost::none /* verbosity */)); + &curOp.debug(), &collection->getCollection(), &parsedUpdate, boost::none /* verbosity */)); { stdx::lock_guard lk(*opCtx->getClient()); @@ -905,7 +905,7 @@ static SingleWriteResult performSingleDeleteOp(OperationContext* opCtx, &hangWithLockDuringBatchRemove, opCtx, "hangWithLockDuringBatchRemove"); auto exec = uassertStatusOK(getExecutorDelete( - &curOp.debug(), collection.getCollection(), &parsedDelete, boost::none /* verbosity */)); + &curOp.debug(), &collection.getCollection(), &parsedDelete, boost::none /* verbosity */)); { stdx::lock_guard lk(*opCtx->getClient()); -- cgit v1.2.1