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}}
- related to
-
SERVER-68297 Document::memUsageForSorter returns an unstable value
- Closed