summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/capped_utils.cpp
diff options
context:
space:
mode:
authorHenrik Edin <henrik.edin@mongodb.com>2020-09-30 11:19:31 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-10-13 00:32:43 +0000
commitbcab0c7e1c1b2e1516d06d23233fea9a425b99f7 (patch)
tree8d805048d69ece52bb64e740532f5968b671865c /src/mongo/db/catalog/capped_utils.cpp
parent0dadef8dd93175bf3a75412d8a32b377d9eba42c (diff)
downloadmongo-bcab0c7e1c1b2e1516d06d23233fea9a425b99f7.tar.gz
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.
Diffstat (limited to 'src/mongo/db/catalog/capped_utils.cpp')
-rw-r--r--src/mongo/db/catalog/capped_utils.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/mongo/db/catalog/capped_utils.cpp b/src/mongo/db/catalog/capped_utils.cpp
index 260fcf446a5..c635d7cf5e9 100644
--- a/src/mongo/db/catalog/capped_utils.cpp
+++ b/src/mongo/db/catalog/capped_utils.cpp
@@ -121,7 +121,7 @@ void cloneCollectionAsCapped(OperationContext* opCtx,
const NamespaceString& toNss,
long long size,
bool temp) {
- const CollectionPtr& fromCollection =
+ CollectionPtr fromCollection =
CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, fromNss);
if (!fromCollection) {
uassert(ErrorCodes::CommandNotSupportedOnView,
@@ -160,7 +160,7 @@ void cloneCollectionAsCapped(OperationContext* opCtx,
uassertStatusOK(createCollection(opCtx, toNss.db().toString(), cmd.done()));
}
- const CollectionPtr& toCollection =
+ CollectionPtr toCollection =
CollectionCatalog::get(opCtx).lookupCollectionByNamespace(opCtx, toNss);
invariant(toCollection); // we created above
@@ -176,7 +176,7 @@ void cloneCollectionAsCapped(OperationContext* opCtx,
auto exec =
InternalPlanner::collectionScan(opCtx,
fromNss.ns(),
- fromCollection,
+ &fromCollection,
PlanYieldPolicy::YieldPolicy::WRITE_CONFLICT_RETRY_ONLY,
InternalPlanner::FORWARD);