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

Sharded view resolution in $lookup incorrectly updates index of match stage

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 5.1.0-rc0
    • None
    • None
    • Fully Compatible
    • ALL
    • QO 2021-09-06
    • 157

    Description

      In sharded $lookup, when the from field of the $lookup is a sharded view and a CommandOnShardedViewNotSupported exception is generated to resolve the pipeline for this view, it is necessary to update the index of the match stage for the field join (_fieldMatchPipelineIdx) to the correct value.

      The initial implementation incorrectly assumed that this stage would always be the last one in the pipeline. The solution is to update the old index of the match stage by adding the length of the view pipeline to it.

      Attachments

        Activity

          People

            alya.berciu@mongodb.com Alya Berciu
            alya.berciu@mongodb.com Alya Berciu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: