We have two different code paths where we check the collection name length.
DatabaseImpl::_checkCanCreateCollection() and userAllowedCreateNS().
The latter function only checks the collection namespace length when running in FCV 4.2, but performs no length checks for FCV 4.4. Renaming a collection within the same database goes through userAllowedCreateNS() as it only needs to modify the catalog's metadata and allows the opportunity to create a collection with a name > 255 characters.
To fix this, we should add the non-FCV namespace length check from _checkCanCreateCollection() into userAllowedCreateNS() too.
- is depended on by
-
SERVER-47836 Rollback multiversion fuzzer should set enableIndexBuildCommitQuorum: false on last-stable mongod binaries
- Closed
- related to
-
SERVER-51333 setFeatureCompatibilityVersion should fail when downgrading from FCV 4.4 to FCV 4.2 with long collection names present
- Closed