[SERVER-82829] [CQF] Update fallback mechanism to allow sharded aggregations to use CQF Created: 06/Nov/23  Updated: 09/Nov/23  Resolved: 09/Nov/23

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

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

Backwards Compatibility: Fully Compatible
Sprint: QO 2023-11-13
Participants:

 Description   

Aggregation commands sent from mongos to shards have let and collation parameters added to them. This causes those queries to fall back to classic, arguably unexpectedly when the original command does not have those fields set. Interestingly, the equivalent find commands do not have those parameters.

We should update the fallback mechanism to allow queries with simple collations and unused let variables to go through CQF. This will allow sharded aggregations to use CQF.



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

Author:

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

Message: SERVER-82829: Update fallback mechanism to allow sharded aggregations to use CQF
Branch: master
https://github.com/mongodb/mongo/commit/74d78d0fe48ba9312902ea9cbd1b6b544abeee0a

Comment by Hana Pearlman [ 08/Nov/23 ]

Alrighty, I'm re-purposing this ticket to make those changes. Thanks for the input!

Comment by David Storch [ 08/Nov/23 ]

I'm not sure what work is required to "support" the simple collation other than allowing it in the fallback mechanism.

Agreed, it should just work.

For let variables, we could ignore the command parameter in the fallback mechanism, and only fall back if we find a variable reference in the query.

Seems reasonable!

Comment by Hana Pearlman [ 08/Nov/23 ]

Agreed, changing how CQF handles these params sounds simplest.

I'm not sure what work is required to "support" the simple collation other than allowing it in the fallback mechanism. 

For let variables, we could ignore the command parameter in the fallback mechanism, and only fall back if we find a variable reference in the query. Or if totally ignoring the parameter seems too extreme, we could special-case NOW and CLUSTER_TIME.

Comment by David Storch [ 08/Nov/23 ]

Sounds like we should just make CQF support collation:{locale:"simple"} if it doesn't already. We may need a separate solution for "$$NOW" and friends.

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