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

Serialize and deserialize NamespaceStrings correctly when multitenancySupport enabled

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • Server Serverless 2022-06-27, Server Serverless 2022-07-11, Server Serverless 2022-07-25, Server Serverless 2022-09-19, Server Serverless 2022-10-03

      When multitenancySupport is enabled, but featureFlagRequireTenantId is disabled, the tenantId should be included when serializing a NamespaceString object. If multitenancySupport is enabled AND featureFlagRequireTenantId is enabled, the tenantId should not be included when serializing a NamespaceString object.

      When multitenancySupport is enabled but featureFlagRequireTenantId is disabled, we should deserialize a NamespaceString obj using parseFromStringExpectTenantIdInMultitenancyMode(). When both are enabled, we'll need to construct the NamespaceString object using a tenantId passed to the constructor separately.

      In this ticket we should write serialize and deserialize methods into a new utilities library that uses the NamespaceString class in order to do this properly. In these functions, let's add an invariant that the tenantId is not initialized when multitenancySupport is disabled. We will also need to write some unit tests to test the serializer/deserializer as producers with various combinations of the flags. There are a number of call sites with TODOs that point to on this ticket that we'll want to repoint to SERVER-69499 since call sites will be modified in that ticket.

            Assignee:
            adi.agrawal@mongodb.com Adi Agrawal
            Reporter:
            janna.golden@mongodb.com Janna Golden
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: