summaryrefslogtreecommitdiff
path: root/src/mongo/db/s/shardsvr_rename_collection_command.cpp
diff options
context:
space:
mode:
authorPierlauro Sciarelli <pierlauro.sciarelli@mongodb.com>2021-02-19 16:40:13 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-02-19 17:14:40 +0000
commite9f91c18323784288cd89cbbb70bc0eca8e89aae (patch)
treee1aaa88cfdc0d83fe2e6e6d02f3d648525758707 /src/mongo/db/s/shardsvr_rename_collection_command.cpp
parent12bb2e9b21029ce01b7a473b5874be04dff29385 (diff)
downloadmongo-e9f91c18323784288cd89cbbb70bc0eca8e89aae.tar.gz
SERVER-54488 Rename Collection might take the unsharded path while sharding a collection
Diffstat (limited to 'src/mongo/db/s/shardsvr_rename_collection_command.cpp')
-rw-r--r--src/mongo/db/s/shardsvr_rename_collection_command.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/s/shardsvr_rename_collection_command.cpp b/src/mongo/db/s/shardsvr_rename_collection_command.cpp
index 3eb11ab03c1..9107b6b0c75 100644
--- a/src/mongo/db/s/shardsvr_rename_collection_command.cpp
+++ b/src/mongo/db/s/shardsvr_rename_collection_command.cpp
@@ -54,9 +54,9 @@ bool isCollectionSharded(OperationContext* opCtx, const NamespaceString& nss) {
CollectionShardingState::get(opCtx, nss)->getCollectionDescription(opCtx).isSharded();
}
-RenameCollectionResponse renameUnshardedCollection(OperationContext* opCtx,
- const ShardsvrRenameCollection& request,
- const NamespaceString& fromNss) {
+RenameCollectionResponse renameCollectionLegacy(OperationContext* opCtx,
+ const ShardsvrRenameCollection& request,
+ const NamespaceString& fromNss) {
const auto& toNss = request.getTo();
const auto fromDB = uassertStatusOK(
@@ -124,8 +124,8 @@ public:
serverGlobalParams.featureCompatibility);
}();
- if (!isCollectionSharded(opCtx, fromNss) || !useNewPath) {
- return renameUnshardedCollection(opCtx, req, fromNss);
+ if (!useNewPath) {
+ return renameCollectionLegacy(opCtx, req, fromNss);
}
uassert(ErrorCodes::InvalidOptions,