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

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 5.2.0, 5.0.5
    • 5.3.0, 5.0.7, 5.2.2
    • None
    • None
    • Fully Compatible
    • ALL
    • v5.2, v5.0
    • QO 2022-02-07, QO 2022-02-21
    • 168

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: