[DOCS-16030] Investigate changes in SERVER-75942: Check that database name is valid UTF-8 when creating a new database Created: 11/Apr/23  Updated: 22/Jan/24

Status: Backlog
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: backlog, feature, sharding
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-75942 Check that database name is valid UTF... Open
Participants:
Days since reply: 43 weeks, 1 day ago

 Description   
Original Downstream Change Summary

This ticket has some interesting upgrade and migration (mongosync et al.) considerations. A user that somehow ends up with one of these bad UTF-8 database names will need to remove or rename them before upgrading.

I am marking documentation changes as "Needed" as, if we make this change, we should update this page on MongoDB database name restrictions: https://www.mongodb.com/docs/manual/reference/limits/

Description of Linked Ticket

When running the attached [^bad_dbname.cpp]script with mongod, we allow the database name to have an invalid utf-8 character (eg. "name\xbc").

When running with mongos, the sharding catalog manager checks if the dbName already exists. It also does a case insensitive match by filtering on the regex (https://github.com/10gen/mongo/blob/master/src/mongo/db/s/config/sharding_catalog_manager_database_operations.cpp/#L176-L180). In doing so, the regex fails with invalid utf-8 (https://github.com/10gen/mongo/blob/master/src/mongo/db/matcher/expression_leaf.cpp/#L245-L247).

We should not allow creating a database with an invalid utf-8 in any of the cases.

This was motivated by investigating  SERVER-57026 and HELP-43395. We should verify that after this change the invalid entries listed in the tickets cannot be created.


Generated at Thu Feb 08 08:14:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.