-
Type: Task
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Fully Compatible
-
Server Serverless 2022-11-14, Server Serverless 2022-11-28
Change the _dbName member to be a DatabaseName object. The AllDatabasesCloner currently passes a string when constructing DatabaseCloner objects, so change this as well.
Then, change the listCollections stage to construct the request correctly according to which flags are enabled - we'll want to use a prefixed dbName if multitenancySupport is enabled but featureFlagRequireTenantID is disabled. If both are enabled, do not include the tenantId in the dbName and instead send $tenant in the request body. The cloner currently uses DBClientBase::getCollectionInfos - one option is to change this function to take in an optional 3rd parameter and pass a TenantId object only if we want to send the request with $tenant. Then, we can use DatabaseNameUtil::serialize to pass the correct string value as the first parameter, and only pass the tenantId as the third parameter if the feature flag is enabled. We'll need to add $tenant to the body of the command here. We'll also need to make sure the getMore correctly includes the tenantId - in order to do this, change DBClientBase::getMore to take in a NamespaceString object rather than a std::string, and then in getCollectionInfos, construct a NamespaceString using NamespaceStringUtil::deserialize here.
Then, change the dbname member on DatabaseCloner::Stats to be a DatabaseName object, and change any call sites in AllDatabaseCloner or DatabaseCloner to pass a DatabaseName object rather than a string.
- depends on
-
SERVER-70415 Attach $tenant to dbStats command during initial sync
- Closed
- is depended on by
-
SERVER-70432 Change CollectionCloner to be tenant aware
- Closed