[SERVER-82121] [CQF] Empty query hint in aggregation should not fail optimization Created: 12/Oct/23  Updated: 27/Nov/23  Resolved: 27/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Militsa Sotirova Assignee: Hana Pearlman
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2023-11-27, QO 2023-12-11
Participants:

 Description   

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.

 



 Comments   
Comment by Githook User [ 22/Nov/23 ]

Author:

{'name': 'Hana Pearlman', 'email': 'hana.pearlman@mongodb.com', 'username': 'HanaPearlman'}

Message: SERVER-82121: Ignore empty hints in CQF
Branch: master
https://github.com/mongodb/mongo/commit/ccbec968d68892cd8983e0f323c805c9c09181a9

Generated at Thu Feb 08 06:48:19 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.