The mdb_catalog can contain a special feature document with an empty namespace. Shard merge doesn't handle this edge case correctly and attempts to read that document, which is incorrect. The fix is TenantFileImporter service should skip the feature document while iterating through the donor mdb_catlog table.
Extra context : Starting from version 5.1 (SERVER-57125), the feature document is no longer generated. But, any database created before version 5.1 may contain this document. This means, trying to execute shard merge on a database created before version 5.1.0 will result in the following error:
{"t":{"$date":"2024-01-25T18:22:56.798+00:00"},"s":"E", "c":"TENANT_M", "id":6615001, "ctx":"TenantFileImporterService","msg":"TenantFileImporterService::_handleEvents encountered an error","attr":{"migrationId":{"uuid":{"$uuid":"dc9ce573-0ece-4bc4-8826-c51d94802c8c"}},"error":"InvalidTenantId: Failed to extract a valid tenant from namespace ''."}}
This was caught in Serverless production where is causing shard merges to fail
- related to
-
SERVER-85837 Obsolete feature document should be removed from mdb_catalog.
- Closed