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

Contained $or access planning is incorrect for $elemMatch object, results in invariant failure

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical - P2
    • Resolution: Fixed
    • Affects Version/s: 3.6.0, 3.7.1
    • Fix Version/s: 3.6.3, 3.7.2
    • Component/s: Querying
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.6
    • Steps To Reproduce:
      Hide

      Run the attached repro.js:

      python buildscripts/resmoke.py repro.js
      

      Show
      Run the attached repro.js : python buildscripts/resmoke.py repro.js
    • Sprint:
      Query 2018-02-12

      Description

      The server crashes when a query is eligible for an OR pushdown through an $elemMatch object with an $or descendent. This issue only affects query shapes that involve an $elemMatch-$or construction, such as the following:

      coll.find({a: 1, $or: [{b: 2}, {b: {$elemMatch: {$or: [{c: 4}, {c: 5}]}}}]});
      

        Attachments

          Activity

            People

            Assignee:
            david.storch David Storch
            Reporter:
            charlie.swanson Charlie Swanson
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            8 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: