ExportXMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 9.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Execution
    • Fully Compatible
    • ALL
    • Hide

      A time-series collection is required to reproduce this:

      ```js
      db.createCollection("c", {timeseries: {timeField: 'time', metaField: 'tag'}});
      db.c.insertMany(documentList); // the 200 docs from the harness (see documentList in the .js)

      const pipe = [{$match: {"obj.obj.obj.num": {$gte: MinKey}}}, {$group: {_id: null, n: {$sum: 1}}}];

      db.adminCommand(

      {configureFailPoint: "disablePipelineOptimization", mode: "off"}

      );
      db.c.aggregate(pipe); // optimization ON -> n = 11 (WRONG)
      db.adminCommand(

      {configureFailPoint: "disablePipelineOptimization", mode: "alwaysOn"}

      );
      db.c.aggregate(pipe); // optimization OFF -> n = 200 (CORRECT)
      ```

      Show
      A time-series collection is required to reproduce this: ```js db.createCollection("c", {timeseries: {timeField: 'time', metaField: 'tag'}}); db.c.insertMany(documentList); // the 200 docs from the harness (see documentList in the .js) const pipe = [{$match: {"obj.obj.obj.num": {$gte: MinKey}}}, {$group: {_id: null, n: {$sum: 1}}}] ; db.adminCommand( {configureFailPoint: "disablePipelineOptimization", mode: "off"} ); db.c.aggregate(pipe); // optimization ON -> n = 11 (WRONG) db.adminCommand( {configureFailPoint: "disablePipelineOptimization", mode: "alwaysOn"} ); db.c.aggregate(pipe); // optimization OFF -> n = 200 (CORRECT) ```
    • QE 2026-08-03, QE 2026-08-17
    • 200
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Encountered while developing: https://github.com/10gen/jstestfuzz/pull/1493
      Failure: https://spruce.corp.mongodb.com/task/jstestfuzz_self_tests_query_agg_fuzzers_master_aggregation_timeseries_fuzzer_timeseries_patch_3e52e1b48e747e600ee484349898e37fbace487d_6a56559cfdcb610007b5dfaf_26_07_14_15_28_31/test-html-log?execution=0&testName=job0%2F1d7637aa-0c0c-4b64-b0e0-f25c40e862a6.log#L0

      `{field: {$gte: MinKey}}` should match every document, no exceptions. On a time-series collection though, that's not what happens: with pipeline optimization enabled the query quietly returns far fewer documents than it should , while with optimization
      disabled it correctly returns all results. Regular (non-time-series) collections behave correctly either way.

      For

      ```js
      [
      { $match: { "obj.obj.obj.num": { $gte:

      { $minKey: 1 }

      } } },
      { $sort:

      { _id: 1 }

      },
      { $sortByCount: { $arrayToObject: [ [
      [ "pish lack", { $ifNull: [ { $max: [ ISODate("0001-01-01T00:00:00Z"),
      { $dateFromParts: { year: NumberLong(6), minute: 10,
      millisecond: { $toInt:

      { $log: [ NumberInt(14), 13 ] }

      } } } ] }, null ] } ],
      [ "if yearly how",

      { $ifNull: [ ISODate("2019-03-04T16:43:26.802Z"), null ] }

      ]
      ] ] } }
      ]
      ```

      • Optimization ON (SBE):
        ```json
        Unknown macro: { "_id"}

        ```

      • Optimization OFF (classic):
        ```json
        Unknown macro: { "_id"}

        ```

            Assignee:
            Parker Felix
            Reporter:
            Hagar Mohamed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: