[SERVER-78502] [CQF] Relax M2 CQF fallback (tryBonsai) to allow {_id: 'hashed'} index Created: 28/Jun/23  Updated: 29/Oct/23  Resolved: 07/Sep/23

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

Type: Task Priority: Major - P3
Reporter: Ben Shteinfeld Assignee: Lynne Wang
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on SERVER-79853 [CQF] Generate SBE expression to hash... Closed
is depended on by SERVER-71280 Add test coverage for currentOp with ... Closed
Assigned Teams:
Query Optimization
Backwards Compatibility: Fully Compatible
Participants:

 Description   

A sharded collection must be backed by an index on the shard key. In M2, we are running through bonsai only for collection scan plans which necessitate there being no indexes on the collection besides the primary index. However many of our sharding suites define {_id: 'hashed'}, so we should support this case to gain more coverage of M2.



 Comments   
Comment by Githook User [ 07/Sep/23 ]

Author:

{'name': 'Lynne Wang', 'email': 'lynne.wang@mongodb.com', 'username': ''}

Message: SERVER-78502 Relax M2 CQF fallback (tryBonsai) to allow {_id: 'hashed'} index

Removed debugging code and updated function comments

Renamed hashed id index check to isHashedIdIndex, added test coverage for queries in hashed id index collections that reference _id

Refactored hashed id index support in cqf logic, disabled currentop_query.js in cqf_experimental_no_passthrough

Added note to update currentOp to test cqf queries

Added comment about hashed id indexes in cqf_get_executor.cpp

Broadened excluded suites from cqf_experimental_incompatible to cqf_incompatible

Deleted unnecessary variables in cqf_command_utils logic for index checking

Used isHashedIdIndex var instead of Index::Btree

Explained inclusion of id hashed indexes in cqf eligibility checker
Branch: master
https://github.com/mongodb/mongo/commit/5826444ef582b593dc49a87f1fed8e8b5fad5ee4

Comment by Ben Shteinfeld [ 23/Aug/23 ]

I think SERVER-79853 only handled the case of a hashed shard key and a collection scan. The remaining work is to update the fallback to allow a query which does not reference _id but has a hashed _id index to go through CQF.

Comment by Hana Pearlman [ 23/Aug/23 ]

Can this be closed as a dupe of SERVER-79853?

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