[SERVER-80202] [CQF] Non-deterministic projection names generated in physical optimizer test breaking golden test Created: 17/Aug/23  Updated: 29/Oct/23  Resolved: 21/Aug/23

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

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

Issue Links:
Depends
Related
related to SERVER-80277 [CQF] Make plan selection as determin... Backlog
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QO 2023-08-21, QO 2023-09-04
Participants:
Linked BF Score: 163

 Description   

The combination of SERVER-78507 and SERVER-78508 results in the RIDIntersect implementor creating two alternatives when optimizing with RemoveOrphansRequirement: (1) delegate RemoveOrphansRequirement to the left child and (2) delegate it to the right child (MemoLogicalDelegator). These rewrites are added to the queue with the same priority and thus removed from the queue in an non-deterministic order.

After SERVER-78507, we are able to optimize SargableNodes with complete/seek requirements + RemoveOrphanRequirement, which means that we attempt to generate alternatives which generates projection names. Depending on the order the alternatives are considered, the projection names we generate will be different.

This goal of this ticket is to refactor the affected tests to only assert on the relevant parts of the plan, to be robust to this non-determinism.



 Comments   
Comment by Githook User [ 21/Aug/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-78507 Satisfy RemoveOrphansRequirement for SargableNode with 'complete' target requirement

The original commit was reverted. Now that SERVER-80202 is fixed,
submitting this commit again.
Branch: master
https://github.com/mongodb/mongo/commit/54c872c327dd8c6b7b731c6d7cc6158485c7dbdb

Comment by Githook User [ 21/Aug/23 ]

Author:

{'name': 'Ben Shteinfeld', 'email': 'ben.shteinfeld@mongodb.com', 'username': 'bshteinfeld'}

Message: SERVER-80202 Remove optimizer test reliance on specific projection name

There are situations where we introduce several alternatives with the
same priority into the queue. Depending on the order in which these
rewrites are attempted, we might generate different projection names,
which breaks golden testing on the plan output.

This patch removes such assertions in two tests and replaces them with
broader assertions about the structure of the resulting plan.
Branch: master
https://github.com/mongodb/mongo/commit/a49bdbfa82b3b26fd2d35293e20a1c489c65d3ae

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