Fix improper reference to input Pipeline object after std::move

XMLWordPrintableJSON

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

      Right now in $rankFusion we improperly reference an input Pipeline object after its already been moved. The moving happens here and the subsequence reference happens here (the 'pipeline' variable is held as a member of the 'inputPipelines' map).

       

      Luckily, we don't actually need the entire Pipeline map in the subsequent call to 'buildScoreAndMergeStages'. All thats actually needed is the names of the input pipelines themselves, so we can instead build a std::vector of the pipeline names and pass that into 'buildScoreAndMergeStages'.

       

      For $scoreFusion, we technically don't reference the input Pipeline object after a move, but we will later on be passing this Pipeline object to DocumentSourceUnionWith, so we need to prepare in the same way. $scoreFusion has an analogous buildScoreAndMergeStages function that takes in the parsed input pipelines map, that has different implementation details, but also in the same way only actually uses the pipeline names, and can instead take in an std::vector of pipeline names instead.

      So the final state of this ticket should be for both $rankFusion and $scoreFusion, the input Pipeline objects should never be referenced after the $unionWith stages are created that wrap the 2nd+ input pipelines.

              Assignee:
              Adithi Raghavan
              Reporter:
              Joe Shalabi
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: