Memory usage for BoundedSorter is invalid when sorting then grouping.

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Fixed
    • Priority: Major - P3
    • 6.0.1, 6.1.0-rc0
    • Affects Version/s: 6.0.0-rc13
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v6.0
    • Execution Team 2022-08-08
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      db.airQuality.aggregate([
      {
      '$match': {
      'metadata.sensorId': {
      '$in': [ 's-test-airQuality-3', 's-test-airQuality-7', 's-test-airQuality-10', 's-test-airQuality-4', 's-test-airQuality-8', 's-test-airQuality-2', 's-test-airQuality-9', 's-test-airQuality-11', 's-test-airQuality-6', 's-test-airQuality-5' ]
      },
      systemTime: {
      '$gt': ISODate('2022-07-20T15:31:49.854Z'),
      '$lt': ISODate('2022-07-21T03:31:49.854Z')
      }
      }
      },
      {
      '$sort': { systemTime: -1 }
      },
      {
      '$group': {
      _id: '$metadata.sensorId',
      doc: { '$first': '$$ROOT' }
      }
      }, {
      '$replaceRoot': { newRoot: '$doc' }
      }
      ])
       
      Exection of the above results in:
      MongoError: PlanExecutor error during aggregation :: caused by :: Memory usage for BoundedSorter is invalid

      This only started happening after atlas auto upgraded our cluster to use mongodb 6.0.0.


      The match step returns just under 400 documents that look like this:

      {

      "systemTime": {
      "$date": "2022-03-26T02:21:35.030Z"
      },
      "metadata": {
      "ns": "test",
      "sensorId": "s-test-airQuality-6"
      },
      "pm25ConcMass": 4.92,
      "_id": {
      "$oid": "629011a313aa1022fcabe391"
      },
      "createdAt": {
      "$date": "2022-05-26T23:47:47.786Z"
      },
      "pm25Aqi": 20,
      "longitude": -90.199122,
      "NO2Aqi": 42,
      "latitude": 29.114455,
      "NO2Conc": 6.71,
      "pm25ConcNum": 6.31,
      "pm10Aqi": 5,
      "pm1ConcMass": 2.58,
      "pm10ConcMass": 5.15,
      "pm1ConcNum": 6.1,
      "pm10ConcNum": 6.37
      {color:#657b83}}

              Assignee:
              Dan Larkin-York
              Reporter:
              Shlomo Shriki
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: