[SERVER-85791] Only parse command request once in command processing path Created: 26/Jan/24  Updated: 07/Feb/24

Status: In Progress
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Patrick Freed Assignee: Patrick Freed
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-42057 IDL option to generate chained setters In Progress
Related
is related to SERVER-80296 Refactor command request processing p... Closed
Sprint: Service Arch 2024-02-05, Service Arch 2024-02-19
Participants:

 Description   

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.


Generated at Thu Feb 08 06:58:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.