Tenant id is dropped off during parsing struct items in IDL command request with OpMsgRequest

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Serverless
    • Fully Compatible
    • ALL
    • Server Serverless 2023-01-09, Server Serverless 2023-01-23
    • 2
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      When command request is parsed from OpMsgRquest object, the tenant id is passed in with OpMsgRquest object's validate tenancy scope.
      Currently, the tenant id can be used correctly to create NamespaceString object or array which is directly defined in the command fields. But, unfortunately, if the field type is defined as a struct and holds tenant id in the struct, the tenant id is dropped off.

      For example, for nsInfo list in bulkWrite command, the nss is defined in struct NamespaceInfoEntry. Here is the IDL generated code for parsing the request

      void BulkWriteCommandRequest::parseProtected(const IDLParserContext& ctxt, const OpMsgRequest& request) {
      ....        
          IDLParserContext tempContext(kNsInfoFieldName, &ctxt);
          const auto localObject = arrayElement.Obj();
           values.emplace_back(mongo::NamespaceInfoEntry::parse(tempContext, localObject));
                            
       }
      

      In the code, tenant id is dropped off when NamespaceInfoEntry is parsed with `NamespaceInfoEntry::parse(tempContext, localObject)` as we didn't pass in OpMsgRequest's validated tenant id to the root IDLParseContext of tempContext. 

       

            Assignee:
            Sophia Tan (Inactive)
            Reporter:
            Sophia Tan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: