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

Improve performance of tenantID/Namespace parsing for oplog entries

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0, 8.0.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Service Arch
    • Fully Compatible
    • v8.0
    • Service Arch 2024-04-01, Service Arch 2024-04-15

      When an oplog entry contains a "tid" and an "ns" field, the parsing of the "ns" field depends on the contents of the "tid" field (and these can come in either order, and the "tid" field may not be present). We handle this since SERVER-66708 by first scanning the object looking for a "tid" field, then passing that into the parser beforehand.

      Scanning a BSON object is fairly expensive so we could achieve better performance by adding a special case in the IDL for this – we could have the "ns" field in the IDL take a parameter specifying the "tid" field, and delay parsing of the "ns" field until the end of the object. We would then scan the object and parse the tid field only once.

      We could also consider handling the "tid" field only when multitenant support is enabled.

      (Handling an absent "tid" field is currently ~10% of the oplog parse in benchmarks)

            Assignee:
            sophia.tan@mongodb.com Sophia Tan
            Reporter:
            matthew.russotto@mongodb.com Matthew Russotto
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: