[SERVER-49827] [SBE] Fix latent bug in ExpressionPostVisitor causing a failure in "sanity.js" Created: 23/Jul/20  Updated: 29/Oct/23  Resolved: 23/Jul/20

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Bug Priority: Major - P3
Reporter: Drew Paroski Assignee: Drew Paroski
Resolution: Fixed Votes: 0
Labels: qexec-team
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

After the fix for SERVER-49123 landed in master, I noticed a new failure starting happening in the "sanity.js" test from the old SBE branch.

Upon investigating the new failure, I discovered that there was a latent bug in generateTraverse() in "sbe_stage_builder_expression.cpp" that has been there for a while. If you look at generateTraverse() around line 304, you'll see a TraverseStage being constructed without a depth limit - let's call this TraverseStage "T". Based on what I know about the code, I'm fairly confident that not having a depth limit on TraverseStage T is wrong.

Prior to the fix for SERVER-49123 (which included the fix for the "TraverseStage depth limit" bug), TraverseStage T happened to produce correct results (at least for the cases that "sanity.js" exercises) because another TraverseStage with a depth limit was filtering out all the array values first before they could reach TraverseStage T. When the "TraverseStage depth limit" bug got fixed, this latent bug emerged (because now there isn't another TraverseStage earlier in the plan tree filtering out array values before they reach TraverseStage T).

The goal of this task is to fix the latent bug in ExpressionPostVisitor so that the "sanity.js" test passes (ignoring the $abs related failures, which is a separate issue).



 Comments   
Comment by Githook User [ 23/Jul/20 ]

Author:

{'name': 'Drew Paroski', 'email': 'drew.paroski@mongodb.com', 'username': 'paroski'}

Message: SERVER-49827 [SBE] Fix latent bug in ExpressionPostVisitor causing a failure in "sanity.js"
Branch: master
https://github.com/mongodb/mongo/commit/20a929019d14e7fab4f9c6f5acf01e2544f37a7a

Generated at Thu Feb 08 05:20:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.