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

Ensure deserializer methods for IDL defined types that construct NamespaceString have access to tenantId

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
    • Fully Compatible
    • Server Serverless 2022-08-08, Server Serverless 2022-08-22, Server Serverless 2022-09-05

      We construct operations from oplog entries, which relies on deserializing or parsing the flattened entries.  This means the parser needs to understand that a "tid:" field may exist, and to pass it into the deserializer method.  Parsing for oplog entries is performed by autogenerated code configured via oplog_entry.idl, which currently iterates through all the fields in the oplog entry and passes the value associated with that field into the deserializer.  However, when constructing NamespaceString objects, we rely on both the "tid:" and the "ns:" fields to pass in as parameters, which this iterating process does not allow for.

      Instead, we would like to add the tenantId field into an existing parameter being passed into the parser, IDLParserContext, and populate the tenantId as we construct the context.  This places the onus of retrieving the tenantId on the caller, which is fine as not all callers will need to be tenantId aware, but could affect a number of call sites.  Specifically for oplog entries, these call sites are limited to DurableOplogEntry::parse(), MutableOplogEntry::parse() (base class for DurableOplogEntry), and OplogEntry:parse().

      Changes to the autogenerated code are also required as we need the parser to retrieve the tenantId from the IDLParserContext, and pass it in as the first parameter to the deserializer, along with the namespace string value.

            hugh.tong@mongodb.com Hugh Tong (Inactive)
            janna.golden@mongodb.com Janna Golden
            0 Vote for this issue
            2 Start watching this issue