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

Improve the way we handle ownership of FindCommandRequest in find command invocation

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Server Programmability
    • Service Arch 2024-04-29, Workload Scheduling 2024-05-27, SP Prioritized List, Workload Scheduling 2024-06-10, Workload Scheduling 2024-06-24, Workload Scheduling 2024-07-08, Workload Scheduling 2024-07-22, Workload Scheduling 2024-08-05

      Currently, the command request for the find command is parsed inside the Invocation::run and Invocation::explain functions, and stored as a unique pointer in a local variable. During the execution of these functions, the ownership of that unique pointer is passed into CanonicalQuery and then further on, until it (potentially) ends up in a cursor that outlives the invocation.

      As a result of the changes in SERVER-86084, the request will be parsed inside the FindCmd::parse and FindCmd::parseForExplain functions and stored in an instance member variable, which will then be used inside Invocation::run and Invocation::explain.

      Passing the ownership of that unique pointer will leave it null and introduce the risk of writing code that can result in a crash. We don't want to block SERVER-86084 on this improvement, so we're filing a separate ticket to investigate how we can prevent this risk and refactor the code accordingly.

            Assignee:
            Unassigned Unassigned
            Reporter:
            vojislav.stojkovic@mongodb.com Vojislav Stojkovic
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: