Improve dependencies between aggregation request helper and pipeline

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Fixed
    • Priority: Major - P3
    • 8.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Integration
    • Fully Compatible
    • None
    • 3
    • TBD
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In SERVER-106011 we had to add 2 forward declarations in pipeline.h for CollectionRoutingInfo and CollectionOrViewAcquisition. We had to do this because aggregation_request_helper includes PlanExecutorPipeline which includes Pipeline. aggregation_request_helper is used by aggregate_command_gen and this file is used in many places in the codebase. This chain makes it very difficult to add any new files to pipeline.h, even if those files are compiled in the same target as pipeline.h because aggregation_request_helper doesn't have access to these files. Also, everytime a file needs aggregation_request_helper the target must also compile plan_executor_pipeline even if the target doesn't directly include this. 

      aggregation_request_helper only includes plan_executor_pipeline for a single helper function that is only used by runAggregate. We can move this helper function into a private namespace for runAggregate and remove the dependency between aggregation_request_helper and plan_executor_pipeline. This will simplify many dependencies and make it easier to add files to pipeline.h in the future.

              Assignee:
              Gil Alon
              Reporter:
              Gil Alon
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: