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

Use Pipeline::optimizeEachStage when restoring from execution plan

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 8.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Atlas Streams
    • Fully Compatible
    • Sprint 62

      In the streams planner, when we restore from a checkpoint, we restore from an (already optimized) execution plan. See more details in https://docs.google.com/document/d/1jGuo2J0y0uUpT333GtBQ4GQ7926alDa2O2BfMlHG1x0/edit?tab=t.0#heading=h.orfw4mdn3m0r.

      Even when we're restoring from an optimized execution plan, we want to iterate through the generated DocumentSource instances and call ::optimize on each. This "self contained" DocumentSource::optimize is safe to do after a checkpoint restore. It will not re-order DocumentSource instances in the Pipeline, which ensures we can still restore from the state in the checkpoint.

      Calling DocumentSource::optimize is helpful because it calls Expression::optimize on all expressions involved in the stage.

      Note that when restoring from optimized execution plan, we will still skip the Pipeline::optimize and associated DocumentSource::doOptimizeAt calls.

            Assignee:
            matthew.normyle@mongodb.com Matthew Normyle
            Reporter:
            matthew.normyle@mongodb.com Matthew Normyle
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: