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

$replaceRoot over $project fails in TS queries lowered to SBE

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • ALL
    • Hide

      run mongod with "--setParameter featureFlagTimeSeriesInSbe=true --setParameter featureFlagSbeFull=true"
      ts is a time-series collection, it's not important whether timeField, metaField or measurement fields are used in the pipeline, as long as the two fields are different.

      db.ts.explain().aggregate([{$project: {c: 1}},{$replaceRoot: {newRoot: {z: "$b"}}}])
      

      result:
      "errmsg" : "Expected build() for UNPACK_TS_BUCKET to either produce a kResult slot or to satisfy all kField reqs",
      "code" : 6023424,

      Show
      run mongod with "--setParameter featureFlagTimeSeriesInSbe=true --setParameter featureFlagSbeFull=true" ts is a time-series collection, it's not important whether timeField, metaField or measurement fields are used in the pipeline, as long as the two fields are different. db.ts.explain().aggregate([{$project: {c: 1}},{$replaceRoot: {newRoot: {z: "$b" }}}]) result: "errmsg" : "Expected build() for UNPACK_TS_BUCKET to either produce a kResult slot or to satisfy all kField reqs", "code" : 6023424,
    • QI 2023-10-16
    • 151

      The first $project stage from the repro pipeline is absorbed into the bucket unpacking stage which, as a result, would only produce slots for "_id" and "c" fields and for kResult, if requested by parent. The $project stage would request a kResult but the $replaceRoot stage doesn't and instead requests a slot for "b", which hasn't been produced.

            Assignee:
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Reporter:
            irina.yatsenko@mongodb.com Irina Yatsenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: