[SERVER-85836] TenantFileImporter service should skip the feature document while iterating through the donor mdb_catlog table. Created: 27/Jan/24  Updated: 08/Feb/24  Resolved: 29/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.2.1, 8.0.0-rc0, 7.3.0-rc2

Type: Bug Priority: Critical - P2
Reporter: Suganthi Mani Assignee: Suganthi Mani
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-85837 Obsolete feature document should be r... Open
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.3, v7.2
Sprint: Execution Team 2024-02-05
Participants:

 Description   

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



 Comments   
Comment by Githook User [ 08/Feb/24 ]

Author:

{'name': 'Suganthi Mani', 'email': '38441312+smani87@users.noreply.github.com', 'username': 'smani87'}

Message: SERVER-85836 TenantFileImporter service skips the feature document while iterating through the donor mdb_catlog table. (#18444)

(cherry picked from commit f6698560cf818fa8527614205353e290910096ee)
Branch: v7.2
https://github.com/mongodb/mongo/commit/ed8e3374454186b2184b06a185f8e6ce1de70dc0

Comment by Githook User [ 29/Jan/24 ]

Author:

{'name': 'Suganthi Mani', 'email': '38441312+smani87@users.noreply.github.com', 'username': 'smani87'}

Message: SERVER-85836 TenantFileImporter service skips the feature document while iterating through the donor mdb_catlog table. (#18444)

(cherry picked from commit f6698560cf818fa8527614205353e290910096ee)

GitOrigin-RevId: 63456a288f5e1e92d31b57dcb8a6e0bbd457fff4
Branch: v7.3
https://github.com/mongodb/mongo/commit/d5ea3dac1308b04262c5587f8d153a25c24b28b4

Comment by Githook User [ 29/Jan/24 ]

Author:

{'name': 'Suganthi Mani', 'email': '38441312+smani87@users.noreply.github.com', 'username': 'smani87'}

Message: SERVER-85836 TenantFileImporter service skips the feature document while iterating through the donor mdb_catlog table. (#18444)

SERVER-85836 TenantFileImporter service skips the feature document while
iterating through the donor mdb_catlog table.

GitOrigin-RevId: f6698560cf818fa8527614205353e290910096ee
Branch: master
https://github.com/mongodb/mongo/commit/aa2f3080a5a248de582c25dc91e2f0ee425b8c2b

Generated at Thu Feb 08 06:58:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.