Fix out of order array element updates for operators like $min

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: 4.4.4
    • Component/s: None
    • None
    • ALL
    • Query Optimization 2021-05-31
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      This issue was fixed on master by SERVER-50778. In 4.4 and order versions, the array updates were done lexicographically on the index keys. So an array value at index 10 would have been updated ahead of say index 3. If there was an array no value at index 10, we would have create array entries with 'null' values upto index 9. Because of the missing field semantics, we would just update the value in $min for index 10. When we try to update index 3 next, there will be a 'null' value. Since the 'null' value is considered less than any other BSON element, we would not update the value for index 3. If the update system had started with index 3 instead, we would have updated both index value 3 and 10.

            Assignee:
            James Wahlin
            Reporter:
            Arun Banala
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: