[SERVER-78904] Modify createWithValidatedTenancyScope to utilize SerializationContext objs Created: 12/Jul/23  Updated: 29/Oct/23  Resolved: 14/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: Hugh Tong (Inactive) Assignee: Hugh Tong (Inactive)
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-78486 Replace parseNamespaceFrom* calls wit... Closed
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2023-07-24, Server Serverless 2023-08-07, Server Serverless 2023-08-21
Participants:

 Description   

createWithValidatedTenancyScope returns an OpMsgRequest with a validated tenancy scope by using the original request as a template to build upon.  It currently calls two other sub-functions, appendDollarDbAndTenant and appendDollarTenant, all of which are used to serialize $tenant and $db fields for OpMsgRequests.  However, they currently call DatabaseNameUtil::serialize() without serialization contexts to form the $db field, and rely on the feature flag to form the $tenant field, which can lead to incorrect/inconsistent prefixing.  They also do not currently form expectPrefix fields (though we would likely want to just pass the field from the original request if it is present).

Because the original request will have previously been parsed, the request object will contain a SerializationContext object.  We should use this SerializationContext to build $tenant and $db fields, and pass expectPrefix to the created request if it exists.

 



 Comments   
Comment by Githook User [ 12/Aug/23 ]

Author:

{'name': 'Hugh Tong', 'email': 'hugh.tong@mongodb.com', 'username': 'cortrain'}

Message: SERVER-78904 Modify createWithValidatedTenancyScope to utilize SerializationContext
Branch: master
https://github.com/mongodb/mongo/commit/6c11b22b256f56b7f435762fd30798ac7de0dba5

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