Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-76867

Add VTS access to BasicCommandWithRequestParser

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Server Serverless 2023-06-12
    • 3

      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.

            Assignee:
            sophia.tan@mongodb.com Sophia Tan
            Reporter:
            hugh.tong@mongodb.com Hugh Tong (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: