Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-16030

Investigate changes in SERVER-75942: Check that database name is valid UTF-8 when creating a new database

      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.

            Assignee:
            Unassigned Unassigned
            Reporter:
            backlog-server-pm Backlog - Core Eng Program Management Team
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              1 year, 3 weeks, 2 days ago