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

[CQF] Empty query hint in aggregation should not fail optimization

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.3.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • Fully Compatible
    • ALL
    • QO 2023-11-27, QO 2023-12-11

      The following query fails when it shouldn't (we should be able to handle an empty hint). Removing the hint field makes the command work as expected, and the command works in classic.

       

      > db.adminCommand({setParameter: 1, internalQueryFrameworkControl: "forceBonsai"})
      { "was" : "trySbeEngine", "ok" : 1 }
      > db.runCommand({aggregate: "test", pipeline: [{$match: {a: {$lt: 5}}}, {$project: {'a': 1}}], hint: {}, explain: true})
      {
       "ok" : 0,
       "errmsg" : "Optimization failed either without tryBonsai set, or without a hint.",
       "code" : 7319401,
       "codeName" : "Location7319401"
      }
      

      Looks like we need to add a check somewhere to handle this empty hint case.

       

            Assignee:
            hana.pearlman@mongodb.com Hana Pearlman
            Reporter:
            militsa.sotirova@mongodb.com Militsa Sotirova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: