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

Only parse command request once in command processing path

    • Service Arch
    • Fully Compatible
    • v8.0
    • Service Arch 2024-02-05, Service Arch 2024-02-19, Service Arch 2024-03-04, Service Arch 2024-03-18, Service Arch 2024-04-01, Service Arch 2024-04-15, Service Arch 2024-04-29, Networking & Obs 2024-05-27, Networking & Obs 2024-06-10, Networking & Obs 2024-06-24
    • 200

      After SERVER-80296 is complete, the number of times the command request BSON is parsed on the command processing path will have greatly reduced. However, even after those changes, each command will still need to perform at least two parses: one for the common args (as consolidated in SERVER-80296) and one for the command-specific fields (often an IDL-generated parse). We should move the latter parsing up earlier in the processing path so that we can combine it with the common argument parsing into a single pass, hopefully improving performance.

      Some commands may still do parsing in multiple steps to allow for early exiting or to distribute the work involved in the parsing (e.g. aggregations may do this with the pipeline), but such cases should not need to walk over the entire request BSON for the subsequent passes.

      This work will also be useful for PM-3613, which needs to inspect command requests in order to determine queuing priority. Moving the parsing step earlier as suggested above allows for such inspections to neither introduce an extra parsing step (which would hurt performance) nor rely on workarounds that could be a bit messy.

            Assignee:
            patrick.freed@mongodb.com Patrick Freed
            Reporter:
            patrick.freed@mongodb.com Patrick Freed
            Votes:
            0 Vote for this issue
            Watchers:
            14 Start watching this issue

              Created:
              Updated:
              Resolved: