-
Type: Bug
-
Resolution: Fixed
-
Priority: Blocker - P1
-
Affects Version/s: 7.0.6
-
Component/s: Aggregation Framework
-
None
-
Query Execution
-
Fully Compatible
-
ALL
-
v7.3
-
QE 2024-03-18
-
(copied to CRM)
On version 7.0.6, MongoDB aggregation pipelines containing all of the following:
- $sort
- $skip
- $limit
- either $lookup or $group after sort-limit-skip
will fail with the following error:
{code: 8349205 codeName: Location8349205 errmsg: Limit code returned unexpected value}
This was an issue in the Slot Based Execution (SBE) query engine that affected $sort operations with a set limit. By default we only execute $lookup and $group in SBE, so the issue only affects aggregations containing these stages.
As an immediate solution, users can do either of the following:
- Downgrade to version 7.0.5
- Disable SBE by setting the internalQueryFrameworkControl parameter to “forceClassicEngine”. This option may come with performance regressions.
db.adminCommand({setParameter: 1, internalQueryFrameworkControl: "forceClassicEngine"})
MongoDB versions 5.0, 6.0 and Rapid Release 7.2 are unaffected.
This issue is fixed in MongoDB 7.0.7.
- is duplicated by
-
SERVER-87324 New 7.0.6 bug: Limit code returned unexpected value
- Closed
-
SERVER-87524 $skip in aggregation does not work
- Closed
- is related to
-
SERVER-87324 New 7.0.6 bug: Limit code returned unexpected value
- Closed
-
SERVER-84436 Handle skip + limit sum overflowing int64_t in SBE
- Closed
- related to
-
SERVER-87479 Manually run SBE build variants on release branches in evergreen to generate and add SBE $group/$lookup tests with $skip/$limit prefixes
- Closed