[SERVER-70190] ExpressionSwitch::optimize() can leave expression tree in an invalid state leading to invariant failure Created: 03/Oct/22  Updated: 29/Oct/23  Resolved: 13/Oct/22

Status: Closed
Project: Core Server
Component/s: Query Execution, Query Planning
Affects Version/s: 6.0.2, 6.1.0-rc3
Fix Version/s: 6.1.1, 6.0.3, 6.2.0-rc0

Type: Bug Priority: Critical - P2
Reporter: David Storch Assignee: David Storch
Resolution: Fixed Votes: 0
Labels: sbe
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
is related to SERVER-56719 Short circuit $switch when any condit... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.1
Sprint: QE 2022-10-17
Participants:
Linked BF Score: 135

 Description   

There is an implementation error in the $switch optimization implemented under SERVER-56719. This can trigger an invariant failure in the SBE stage builder.



 Comments   
Comment by Githook User [ 17/Oct/22 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-70190 Fix ExpressionSwitch::optimize() to manage _children vector correctly

(cherry picked from commit 2cc7da28b9ddd1eb91516a2ba25f7dd67db88ca8)
Branch: v6.0
https://github.com/mongodb/mongo/commit/b8ee98e8039dcffefb4ad226c4829ffa2aaa3ece

Comment by Githook User [ 14/Oct/22 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-70190 Fix ExpressionSwitch::optimize() to manage _children vector correctly

(cherry picked from commit 2cc7da28b9ddd1eb91516a2ba25f7dd67db88ca8)
Branch: v6.1
https://github.com/mongodb/mongo/commit/52799a318105b7cfb22ece697d617b5363a0f5e6

Comment by Githook User [ 13/Oct/22 ]

Author:

{'name': 'David Storch', 'email': 'david.storch@mongodb.com', 'username': 'dstorch'}

Message: SERVER-70190 Fix ExpressionSwitch::optimize() to manage _children vector correctly
Branch: master
https://github.com/mongodb/mongo/commit/2cc7da28b9ddd1eb91516a2ba25f7dd67db88ca8

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