Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-68835

Mark the tenantdID field as "optional: true" for recipientSyncData and donorStartMigration commands.

    • Fully Compatible
    • Server Serverless 2022-08-22

      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

            Assignee:
            christopher.caplinger@mongodb.com Christopher Caplinger
            Reporter:
            suganthi.mani@mongodb.com Suganthi Mani
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: