[SERVER-78262] Create a DatabaseName serialize function for serialization db without tenant prefix Created: 21/Jun/23  Updated: 29/Oct/23  Resolved: 17/Aug/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
is depended on by SERVER-77537 Make DatabaseName::db() private Closed
Assigned Teams:
Serverless
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2023-06-26
Participants:
Story Points: 1

 Description   

We are making the DatabaseName::db() private to avoid developers dropping tenant prefix when the tenant prefix is actually required in some use cases. But, there still are some use cases in which tenant prefix is not required, for example:

  • the OpMsgRequest should has non prefixed db name if there is "$tenant" in msg body.
  • the change stream events.
  • the internal created BSON object for parsing command request with IDLParserContext and known tenant id.
  • document source lookup output.


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

Author:

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

Message: SERVER-78262 add a suffix _UNSAFE to function name serializeWithoutTenantPrefix
Branch: master
https://github.com/mongodb/mongo/commit/c05348f3d64710eafa792b8c136bdfb7c978862f

Comment by Githook User [ 22/Jun/23 ]

Author:

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

Message: SERVER-78262 Create a DatabaseName serialize function for serialization db without tenant prefix
Branch: master
https://github.com/mongodb/mongo/commit/5490aa1a1eefffe9c6a51500d6f1cffa130f3795

Comment by Sophia Tan [ 21/Jun/23 ]

Approach 1: Create a SerializationContext and set it to exclude tenant prefix. Serialize the db name with this context and call "DatabaseNameUtil::serializeForCommands(dbName, scExcludePrefix)". 

This can only be used for command request or reply serialization. There are some other use cases which is not for request/reply. 

Approach 2: Create a new function  "DatabaseName::serializeNonTenantPrefix()". This function can be used for the use cases which are not request/reply serialization. 

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