[SERVER-76867] Add VTS access to BasicCommandWithRequestParser Created: 04/May/23  Updated: 29/Oct/23  Resolved: 07/Jun/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: 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-74284 Fix existing tests for command serial... Closed
Backwards Compatibility: Fully Compatible
Sprint: Server Serverless 2023-06-12
Participants:
Story Points: 3

 Description   

CollModStats and CollectionModCmd rely on 
`BasicCommandWithRequestParser:runWithReplyBuilder()` to return a `RequestParser` object that contains a correctly parsed `_request` member object.  However, the `RequestParser` calls the `parse(IDLParserContext&, BSONObj&)` override, which does not have access to the ValidatedTenancyScope (VTS), normally stored on the `OpMsgRequest`.  This means the parser called by `RequestParser` will not return a `SerializationContext` with the correct flag that detects whether or not the VTS contains a valid tenant ID, which is consumed and required by the Util serialize() calls.

We need to either access the VTS or a boolean flag at the `RequestParser` object so that we can override the flags being passed into the `parse(IDLParserContext&, BSONObj&)` override, in order to correctly set the `SerializationContext` held on the request.
 
As the goal of these changes are in pursuit of fixing tests that will fail once serializeForCommands and deserializeForCommands are plumbed in, no new tests are being added for this ticket.



 Comments   
Comment by Felipe Gasper [ 28/Jul/23 ]

This seems to allow collMod on a time-series buckets collection. Is that intended?

Comment by Githook User [ 07/Jun/23 ]

Author:

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

Message: SERVER-76867 Make CollModStats and CollectionModCmd access OpMsgRequest and its VTS
Branch: master
https://github.com/mongodb/mongo/commit/8a181bedc5a7ec9e738d64c9439dfebfae75b545

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