diff options
author | Pierlauro Sciarelli <pierlauro.sciarelli@mongodb.com> | 2021-02-19 16:40:13 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-02-19 17:14:40 +0000 |
commit | e9f91c18323784288cd89cbbb70bc0eca8e89aae (patch) | |
tree | e1aaa88cfdc0d83fe2e6e6d02f3d648525758707 /src/mongo/db/s/shardsvr_rename_collection_command.cpp | |
parent | 12bb2e9b21029ce01b7a473b5874be04dff29385 (diff) | |
download | mongo-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.cpp | 10 |
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, |