diff options
author | Antonio Fuschetto <antonio.fuschetto@mongodb.com> | 2022-02-02 13:57:50 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2022-02-02 15:27:01 +0000 |
commit | b96cf6c3cd26e240b84e40756b148b2e3cfde063 (patch) | |
tree | 655e663f0e54261a27cdde93d635a9f10ff3af16 /src/mongo/db/s/sharding_ddl_util.h | |
parent | d6a545506f7842ec6bc369ed7aedcdb8c2d40cd6 (diff) | |
download | mongo-b96cf6c3cd26e240b84e40756b148b2e3cfde063.tar.gz |
SERVER-62906 Add a check in the createCollection/shardCollection path verifying the collection name length
Diffstat (limited to 'src/mongo/db/s/sharding_ddl_util.h')
-rw-r--r-- | src/mongo/db/s/sharding_ddl_util.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/mongo/db/s/sharding_ddl_util.h b/src/mongo/db/s/sharding_ddl_util.h index 1cfba12be74..afe53cd5ee6 100644 --- a/src/mongo/db/s/sharding_ddl_util.h +++ b/src/mongo/db/s/sharding_ddl_util.h @@ -104,13 +104,15 @@ void shardedRenameMetadata(OperationContext* opCtx, const WriteConcernOptions& writeConcern); /** - * Ensures rename preconditions for sharded collections are met: + * Ensures rename preconditions for collections are met: + * - Check that the namespace of the destination collection is not too long * - Check that `dropTarget` is true if the destination collection exists * - Check that no tags exist for the destination collection */ -void checkShardedRenamePreconditions(OperationContext* opCtx, - const NamespaceString& toNss, - bool dropTarget); +void checkRenamePreconditions(OperationContext* opCtx, + bool sourceIsSharded, + const NamespaceString& toNss, + bool dropTarget); /** * Throws if the DB primary shards of the provided namespaces differs. |