summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/rename_collection_coordinator.cpp
diff options
context:
space:
mode:
authorDan Larkin-York <dan.larkin-york@mongodb.com>2022-02-26 13:50:02 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-02-26 14:34:46 +0000
commitcd92f1325982f82314e0cbb08ced8d254198a7b2 (patch)
tree5539b750af2e6ed189698edbe994d3f3b64bf194 /src/mongo/db/s/rename_collection_coordinator.cpp
parentfcad5cd7a9267980fefda51b1e4a3db0a12000ec (diff)
downloadmongo-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.cpp14
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);