diff options
author | Dan Larkin-York <dan.larkin-york@mongodb.com> | 2022-02-26 13:50:02 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-26 14:34:46 +0000 |
commit | cd92f1325982f82314e0cbb08ced8d254198a7b2 (patch) | |
tree | 5539b750af2e6ed189698edbe994d3f3b64bf194 /src/mongo/db/s/rename_collection_coordinator.cpp | |
parent | fcad5cd7a9267980fefda51b1e4a3db0a12000ec (diff) | |
download | mongo-cd92f1325982f82314e0cbb08ced8d254198a7b2.tar.gz |
SERVER-57250 Merge ViewCatalog into CollectionCatalog
Diffstat (limited to 'src/mongo/db/s/rename_collection_coordinator.cpp')
-rw-r--r-- | src/mongo/db/s/rename_collection_coordinator.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/mongo/db/s/rename_collection_coordinator.cpp b/src/mongo/db/s/rename_collection_coordinator.cpp index 577b55a4ed2..b8c882d4def 100644 --- a/src/mongo/db/s/rename_collection_coordinator.cpp +++ b/src/mongo/db/s/rename_collection_coordinator.cpp @@ -44,7 +44,6 @@ #include "mongo/db/s/sharding_logging.h" #include "mongo/db/s/sharding_state.h" #include "mongo/db/s/sharding_util.h" -#include "mongo/db/views/view_catalog.h" #include "mongo/idl/idl_parser.h" #include "mongo/logv2/log.h" #include "mongo/s/catalog/sharding_catalog_client.h" @@ -198,15 +197,10 @@ ExecutorFuture<void> RenameCollectionCoordinator::_runImpl( // Make sure the target namespace is not a view { - Lock::DBLock dbLock(opCtx, toNss.db(), MODE_IS); - const TenantDatabaseName tenantDbName(boost::none, toNss.db()); - const auto db = DatabaseHolder::get(opCtx)->getDb(opCtx, tenantDbName); - if (db) { - uassert(ErrorCodes::CommandNotSupportedOnView, - str::stream() << "Can't rename to target collection `" << toNss - << "` because it is a view.", - !ViewCatalog::get(opCtx)->lookup(opCtx, toNss)); - } + uassert(ErrorCodes::CommandNotSupportedOnView, + str::stream() << "Can't rename to target collection `" << toNss + << "` because it is a view.", + !CollectionCatalog::get(opCtx)->lookupView(opCtx, toNss)); } const auto optTargetCollType = getShardedCollection(opCtx, toNss); |