[SERVER-70415] Attach $tenant to dbStats command during initial sync Created: 10/Oct/22  Updated: 29/Oct/23  Resolved: 15/Nov/22

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

Type: Task Priority: Major - P3
Reporter: Janna Golden Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-70430 Change DatabaseCloner to be tenant aware Closed
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2022-10-17, Server Serverless 2022-10-31, Server Serverless 2022-11-14, Server Serverless 2022-11-28
Participants:

 Description   

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.



 Comments   
Comment by Githook User [ 15/Nov/22 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-70415 Attach tenantId to dbStats during initial sync
Branch: master
https://github.com/mongodb/mongo/commit/919b31026d9d3c629bfd5f29556e3a532395dc62

Comment by Githook User [ 15/Nov/22 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-70415 Attach tenantId to dbStats command during initial sync
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/a661ecf7ee48c3be30842722b548370e9467bc2d

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