Avoid code duplicate in preparePipelineForExecution() and targetShardsAndAddMergeCursors() when routing pipelines

XMLWordPrintableJSON

    • Query Execution
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Currently two separate methods exist to route pipeline to the corresponding shards.

      While working on SERVER-95976, I introduced a new code path that uses targetShardsAndAddMergeCursors(). However, it was causing failures in change stream due to StaleConfig exception. The reason for that was lack of router API usage that takes care of these exceptions. Upon closer look, it seems that both methods seem to do same logic, just one has the AggregateCommandRequest passed to the method, while the other does not.

      We should investigate if we:

      • can have only one method instead of two
      • in case of having two different methods, reuse the newly introduced routePipeline() method, which should be doing same logic for both methods

              Assignee:
              Unassigned
              Reporter:
              Denis Grebennicov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: