[SERVER-77537] Make DatabaseName::db() private Created: 26/May/23  Updated: 29/Oct/23  Resolved: 27/Jul/23

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

Type: Task Priority: Major - P3
Reporter: Sophia Tan Assignee: Sophia Tan
Resolution: Fixed Votes: 0
Labels: ntdi_must_have
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-78005 Replace DatabaseName::db() with other... Closed
depends on SERVER-78046 Check DatabaseName object is admin, c... Closed
depends on SERVER-78112 Change call sites of `DatabaseName::d... Closed
depends on SERVER-78261 Avoid too long db name in multitenanc... Closed
depends on SERVER-78262 Create a DatabaseName serialize funct... Closed
depends on SERVER-78263 Serialize db name in the listDatabase... Closed
depends on SERVER-79341 Make CollectionUUIDMismatchInfo seria... Closed
Gantt Dependency
has to be done before SERVER-65456 Make NamespaceString::db_deprecated()... Closed
Related
is related to SERVER-76771 Change audit::log*Database to use a D... Closed
Assigned Teams:
Serverless
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2023-06-26, Server Serverless 2023-07-10, Server Serverless 2023-07-24, Server Serverless 2023-08-07
Participants:
Story Points: 5

 Description   

There are a lot of code places which call " DatabaseName::db()" so that the tenant information is dropped off. In this ticket, we should make this function private and change its call sites too. 



 Comments   
Comment by Githook User [ 27/Jul/23 ]

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-77537 Make DatabaseName::db() private - change DatabaseName code
Branch: master
https://github.com/mongodb/mongo/commit/77c6faa5182317f4c31b284903db4863b0437c7d

Comment by Githook User [ 27/Jul/23 ]

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-77537 Make DatabaseName::db() private - async rpc
Branch: master
https://github.com/mongodb/mongo/commit/b5fcc18af692ebe1196e33a454a763f2cc431e44

Comment by Githook User [ 21/Jul/23 ]

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-77537 Make DatabaseName::db() private (mr command)
Branch: master
https://github.com/mongodb/mongo/commit/c0da733b95f0eb206357d36ab9cb9c51bebaa8be

Comment by Githook User [ 19/Jul/23 ]

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-77537 Make DatabaseName::db() private (tenant migration code)
Branch: master
https://github.com/mongodb/mongo/commit/cdbd2889ee04bb6c54dedd541b20eafaae109db3

Comment by Githook User [ 18/Jul/23 ]

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-77537 Make DatabaseName::db() private (auth code)
Branch: master
https://github.com/mongodb/mongo/commit/3ad4a5ff13f42610bfeb8f34e512a72d172d2c37

Comment by Githook User [ 17/Jul/23 ]

Author:

{'name': 'Sophia Tan', 'email': 'sophia_tll@hotmail.com', 'username': 'sophiatll'}

Message: SERVER-77537 Make DatabaseName::db() private - get db size with size() or dbSize() functions
Branch: master
https://github.com/mongodb/mongo/commit/5373587b493d110b90c391af23d09ae93a164580

Comment by Sophia Tan [ 15/Jun/23 ]

We need not to remove the `db()` function from DatabaseName::kAdmin and other constant dbs. There are the reasons:

  • Correctness: This `db()` function can work correctly on the serialization of those dbs as they have no tenant id.
  • Easy to read the code: `db()` is more easy to be read than `DatabaseNameUtil::serialzie(DatabaseName::kAdminDb)`. It's short and clear.
Generated at Thu Feb 08 06:35:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.