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

[v7.0] [SBE] Aggregate command hits tripwire assertion in SortStage::SortImpl::runLimitCode()

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 7.0.7
    • Affects Version/s: 7.0.6
    • Component/s: Aggregation Framework
    • Labels:
      None
    • Query Execution
    • Fully Compatible
    • ALL
    • v7.3
    • QE 2024-03-18

      Issue Status as of Mar 18, 2024

      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.

            Assignee:
            ivan.fefer@mongodb.com Ivan Fefer
            Reporter:
            kyle.suarez@mongodb.com Kyle Suarez
            Votes:
            5 Vote for this issue
            Watchers:
            64 Start watching this issue

              Created:
              Updated:
              Resolved: