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

Pushing predicates on the time-series metaField past unpacking can cause incorrect results

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0, 5.0.7, 5.2.2
    • Affects Version/s: 5.2.0, 5.0.5
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • v5.2, v5.0
    • QO 2022-02-07, QO 2022-02-21
    • 168

      We attempt to push predicates on the time-series metaField past the $_internalUnpackBucket stage so we can avoid unpacking buckets when possible. However, we may inadvertently push the predicate past another stage which may alter the document contents (e.g. $project) which can affect whether the document satisfies the predicate. For example:

      [
          {$project: {measurement: 1}},
          {$match: {meta: {$lt: 100}}},
      ]
      

      If we evaluate the predicate at the bucket level, we may get results, while if we evaluate after unpacking, we'll get an empty result set.

            Assignee:
            dan.larkin-york@mongodb.com Dan Larkin-York
            Reporter:
            dan.larkin-york@mongodb.com Dan Larkin-York
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: