diff options
author | Gregory Noma <gregory.noma@gmail.com> | 2022-10-21 14:14:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-10-21 14:46:55 +0000 |
commit | 478c1607b57bc725eee1bec6ca04f177d4de1520 (patch) | |
tree | 1c8cd8047eb33e37e818e365416535a6ae250fe5 /src/mongo/db/commands/find_cmd.cpp | |
parent | 06e43e02a452ae1c4fffcffb0242b4a528bdacb4 (diff) | |
download | mongo-478c1607b57bc725eee1bec6ca04f177d4de1520.tar.gz |
SERVER-68337 Perform `collectionUUID` check inside `AutoGetCollection`
Diffstat (limited to 'src/mongo/db/commands/find_cmd.cpp')
-rw-r--r-- | src/mongo/db/commands/find_cmd.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/commands/find_cmd.cpp b/src/mongo/db/commands/find_cmd.cpp index c3d62936a84..5036cce11e5 100644 --- a/src/mongo/db/commands/find_cmd.cpp +++ b/src/mongo/db/commands/find_cmd.cpp @@ -288,7 +288,8 @@ public: boost::optional<AutoGetCollectionForReadCommandMaybeLockFree> ctx; ctx.emplace(opCtx, CommandHelpers::parseNsCollectionRequired(_dbName, _request.body), - auto_get_collection::ViewMode::kViewsPermitted); + AutoGetCollection::Options{}.viewMode( + auto_get_collection::ViewMode::kViewsPermitted)); const auto nss = ctx->getNss(); // Going forward this operation must never ignore interrupt signals while waiting for @@ -473,7 +474,9 @@ public: boost::optional<AutoGetCollectionForReadCommandMaybeLockFree> ctx; ctx.emplace(opCtx, CommandHelpers::parseNsOrUUID(_dbName, _request.body), - auto_get_collection::ViewMode::kViewsPermitted); + AutoGetCollection::Options{} + .viewMode(auto_get_collection::ViewMode::kViewsPermitted) + .expectedUUID(findCommand->getCollectionUUID())); const auto& nss = ctx->getNss(); // Going forward this operation must never ignore interrupt signals while waiting for @@ -490,9 +493,6 @@ public: << " specified in query request not found", ctx || !findCommand->getNamespaceOrUUID().uuid()); - checkCollectionUUIDMismatch( - opCtx, nss, ctx->getCollection(), findCommand->getCollectionUUID()); - // Set the namespace if a collection was found, as opposed to nothing or a view. if (ctx) { query_request_helper::refreshNSS(ctx->getNss(), findCommand.get()); |