[SERVER-70597] QueryPlannerAccess::processIndexScans fails when MatchExpression is not optimized Created: 14/Oct/22  Updated: 29/Oct/23  Resolved: 17/Jan/23

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

Type: Improvement Priority: Major - P3
Reporter: David Percy Assignee: David Percy
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 13

 Description   

It looks like when the 'disableMatchExpressionOptimization' failpoint is set, QueryPlannerAccess can do an incorrect static_cast.

We should fix this to prevent it from happening in the optimization fuzzer. We also might as well use checked_cast to make diagnosis easier.



 Comments   
Comment by Githook User [ 17/Jan/23 ]

Author:

{'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}

Message: SERVER-70597 Don't generate OrPushdown tags when optimization is disabled
Branch: master
https://github.com/mongodb/mongo/commit/f7dc2ed1335f3d24e69ac5a147f8eff2f131816a

Comment by Githook User [ 30/Nov/22 ]

Author:

{'name': 'David Percy', 'email': 'david.percy@mongodb.com', 'username': 'dpercy'}

Message: SERVER-70597 Use checked_cast for downcast from TagData to IndexTag

When tests use disableMatchExpressionOptimization (an internal-only
feature), some of these casts are incorrect. Using checked_cast will
give us a well defined crash instead of UB when this happens, which
should make the test failures easier to deduplicate.
Branch: master
https://github.com/mongodb/mongo/commit/70cb8b5a4c99802f6b5ee7b0c3439fc34742508c

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