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

Always sort fieldpath string sets using custom comparator

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 6.1.0-rc0, 6.0.5
    • None
    • None
    • Fully Compatible
    • v6.0
    • QO 2022-06-27, QO 2022-07-11

    Description

      Whenever we store sets of field paths strings (eg., ["a.b", "a", "c.d"]) use a custom string comparator that treats "." as the first character.

      This is to protect us against future bugs like SERVER-66418.  It also makes the solution to that issue more efficient (because it avoids a set copy) and would allow O(n log n) solutions to many field path comparison functions that currently are O(n^2).  For example `isIndependentOf` and `isOnlyDependentOn` in https://github.com/mongodb/mongo/blob/master/src/mongo/db/matcher/expression_algo.cpp#L802

      Attachments

        Issue Links

          Activity

            People

              steve.tarzia@mongodb.com Steve Tarzia
              steve.tarzia@mongodb.com Steve Tarzia
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: