[SERVER-61822] Create new command listDatabasesForAllTenants Created: 30/Nov/21  Updated: 29/Oct/23  Resolved: 12/Aug/22

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

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

Issue Links:
Depends
depends on SERVER-61988 Change CollectionCatalog maps that ar... Closed
Related
related to SERVER-69100 Complete TODO listed in SERVER-61822 Closed
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2022-08-08, Server Serverless 2022-08-22
Participants:

 Description   

This command should take the same options as the existing listDatabases command, and return the same objects in the response, but with an extra field "tenant" in each object in the "databases" list (see the existing listCommands command here). So, today the response should look like:

{
   "databases" : [
      {
         "name" : "xxx",
         "tenant": OID, // new field
         "sizeOnDisk" : xxx,
         "empty" : bool
      }
   ],
   "totalSize" : xxx,
   "totalSizeMb" : xxx,
   "ok" : 1
}

In order to get tenantID info from the CollectionCatalog, change StorageEngineImpl::listDatabases() to return a vector of TenantDatabaseNames. Then, we can split out the db name from the tenantId for each TenantDatabseName object, and include this information separately in the response, as described above.

This command must only be allowed for the internal security user, when using traditional connection based auth. The "name" field should only contain the database name (and not the tenant prefix).



 Comments   
Comment by Githook User [ 11/Aug/22 ]

Author:

{'name': 'Fernando Lisboa', 'email': 'fernando.lisboa@mongodb.com', 'username': 'fernandolis10'}

Message: SERVER-61822 Create new command listDatabasesForAllTenants
Branch: master
https://github.com/mongodb/mongo/commit/408c0cfc46ca7adccb7f4784a6ec6a6d167b0991

Generated at Thu Feb 08 05:53:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.