summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog_raii.cpp
diff options
context:
space:
mode:
authorBenety Goh <benety@mongodb.com>2022-04-06 06:11:55 -0400
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-04-06 12:08:39 +0000
commit729774b7c096ef0a3a6158c5394245937b883667 (patch)
tree948a43b0c13f54616f39fd8d24ccc55a72260478 /src/mongo/db/catalog_raii.cpp
parentfc999fe67861f0c40f432bade6091f70de84f8f1 (diff)
downloadmongo-729774b7c096ef0a3a6158c5394245937b883667.tar.gz
SERVER-65137 LookupCollectionForYieldRestore saves collection namespace at construction
Diffstat (limited to 'src/mongo/db/catalog_raii.cpp')
-rw-r--r--src/mongo/db/catalog_raii.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/catalog_raii.cpp b/src/mongo/db/catalog_raii.cpp
index d4040b1c03e..b861af2f10b 100644
--- a/src/mongo/db/catalog_raii.cpp
+++ b/src/mongo/db/catalog_raii.cpp
@@ -331,11 +331,14 @@ Collection* AutoGetCollection::getWritableCollection(OperationContext* opCtx) {
// new write unit of work is opened.
opCtx->recoveryUnit()->registerChange(
[this, opCtx](boost::optional<Timestamp> commitTime) {
- _coll = CollectionPtr(opCtx, _coll.get(), LookupCollectionForYieldRestore());
+ _coll =
+ CollectionPtr(opCtx, _coll.get(), LookupCollectionForYieldRestore(_coll->ns()));
_writableColl = nullptr;
},
[this, originalCollection = _coll.get(), opCtx]() {
- _coll = CollectionPtr(opCtx, originalCollection, LookupCollectionForYieldRestore());
+ _coll = CollectionPtr(opCtx,
+ originalCollection,
+ LookupCollectionForYieldRestore(originalCollection->ns()));
_writableColl = nullptr;
});