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

Attach $tenant to dbStats command during initial sync

    • 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-10-17, Server Serverless 2022-10-31, Server Serverless 2022-11-14, Server Serverless 2022-11-28

      When featureFlagRequireTenantID is enabled, we must send $tenant when sending dbStats for each database that we're cloning. The AllDatabasesCloner will send listDatabasesForAllTenants, but currently we'll just take the name portion of this command to put in the _databases map.

      As a part of this ticket, change _databases to be a list of DatabaseName objects. We'll need to correctly construct the DatabaseName object to put in the _databases vector - if SERVER-70053 is completed, we can use the deserializer added in this ticket. If not, we can use the NamespaceStringUtil::deserializer for now and just grab the dbName from it, then leave a TODO to change to this in SERVER-70053. Regardless, we'll need to grab the tenantId from the tenantId field in the listDatabasesForAllTenants response to construct it.

      Then, pass the tenantId to the dbStats command by sending $tenant in the dbStats command body.

      We'll need to call toStringWithTenantId() on the dbName object in a few places where we construct/interact with DatabaseCloner objects because we haven't yet changed the DatabaseCloner to use a DatabaseName object (i.e. here and here, and likely a few other places in AllDatabaseCloner).

      Let's also add a unit test similar to this one to check that this works when multitenancySupport and featureFlagRequireTenantID are enabled. Also, let's add tests with our flags that check that admin is still first, and local is removed properly like these two - currently, we don't use the system tenantId yet, but we will eventually and so it will be good to check that we still sort/filter correctly.

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

              Created:
              Updated:
              Resolved: