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

Bad projection created during dependency analysis due to string order assumption

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.0.7, 6.0.0-rc6, 6.1.0-rc0
    • 5.0.10, 6.0.0-rc11, 4.4.16, 4.2.22, 6.1.0-rc0
    • None
    • None
    • Fully Compatible
    • ALL
    • v6.0, v5.0, v4.4, v4.2
    • QO 2022-06-13, QE 2022-06-27

    Description

      If there’s not a projection at the front of a pipeline during planning, we'll try to create one to push down by doing dependency analysis on the pipeline, then constructing a projection from the results. The logic for converting the dependency analysis results to a projection spec relies on set iterators going in lexicographic order so that a string is always directly before all of the fields it prefixes.

      That is true in some cases. If the pipeline has dependencies on “a.b” and “a.b.c”, then we process the strings in that order and we create a projection indicating that “a.b” should be included.

      However, if the pipeline has dependencies on “a.b”, “a.b.c”, and “a.b-d”, then the order we process the fields in is “a.b”, “a.b-d”, “a.b.c”. As a result, we try to create a projection indicating that all three fields should be included. This fails with a path collision error.

      Attachments

        Issue Links

          Activity

            People

              steve.tarzia@mongodb.com Steve Tarzia
              matt.boros@mongodb.com Matt Boros
              Votes:
              0 Vote for this issue
              Watchers:
              17 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: