[SERVER-68835] Mark the tenantdID field as "optional: true" for recipientSyncData and donorStartMigration commands. Created: 15/Aug/22  Updated: 29/Oct/23  Resolved: 16/Aug/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.1.0-rc0

Type: Task Priority: Major - P3
Reporter: Suganthi Mani Assignee: Christopher Caplinger
Resolution: Fixed Votes: 0
Labels: shard-merge-milestone-1
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2022-08-22
Participants:

 Description   

We made tenantID as optional for recipientSyncData and donorStartMigration by declaring the default value for tenantID field as empty string with the fact that default values won't go into the tenantId validation check. But side-effect of declaring the tenantID with default on idl file is that donor creates recipientSyncData request BSON object with tenantID field set as empty string even if the tenantID in the recipientSyncData object instance is not set for shard merge protocol. This in-turn causes the recipient to fail the recipientSyncData cmd because the recipient now receives a recipientSyncData cmd with the tenantID as empty string. This causes the tenantID to go into tenantID validation check and causing it to fail with ErrorCodes:BadValue.

We fixed this temporarily in SERVER-63454 by removing empty string from kUnsupportedTenantIds. This means the shard split will now be able to accept the tenantID as empty string

Cleaner fix is to set optional:true for tenantID in the tenant migration cmd idl files (here and here) and also remove the tenantID validator from the tenantMigrationRecipientDocument as for shard merge protocol after SERVER-63454 the tenantID would be an empty string, just validating the tenantID at the command layer should be sufficient



 Comments   
Comment by Githook User [ 16/Aug/22 ]

Author:

{'name': 'Christopher Caplinger', 'email': 'christopher.caplinger@mongodb.com', 'username': 'UnicodeSnowman'}

Message: SERVER-68835: Mark tenantId as optional for tenant migration cmds
Branch: master
https://github.com/mongodb/mongo/commit/497e8c7b8fe3b3b4053b58231167d25c54d0faff

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