[SERVER-57291] Investigate stack overflow in SBE plans Created: 28/May/21  Updated: 29/Oct/23  Resolved: 29/Jul/21

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

Type: Task Priority: Major - P3
Reporter: Ian Boros Assignee: Jennifer Peshansky (Inactive)
Resolution: Fixed Votes: 0
Labels: sbe-post-v1, sbe-rollout
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-57225 SBE plans may trigger stack overflow Closed
Backwards Compatibility: Fully Compatible
Sprint: Query Execution 2021-06-14, Query Execution 2021-06-28, Query Execution 2021-07-12, Query Execution 2021-07-26, QE 2021-08-09
Participants:

 Description   

As discussed in SERVER-57225, SBE plans with large top-level ANDs may result in a stack overflow. While fixing this particular scenario is straightforward, there may be other queries which cause stack overflow in SBE that we have not discovered yet.

We should spend some time investigating whether any such queries exist, and if so, build a more generic mechanism for tracking SBE tree depth during plan construction. If the plan exceeds some fixed depth, we'd have to bail out and either use the classic engine (or, eventually fail the query).

 

A few ideas for queries which may be able to trigger this:

-A query with a filter or projection on a very long path (a.b.c.d.e.f...)

-A query with many nested $and and $ors

-A query with a $slice or positional projection on a very long path



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 29/Jul/21 ]

Author:

{'name': 'Jennifer Peshansky', 'email': 'jennifer.peshansky@mongodb.com', 'username': 'jenniferpeshansky'}

Message: SERVER-57291 Add path length check to expression_parser and tests.
Branch: master
https://github.com/mongodb/mongo/commit/c036bbad40012454725f24414e4cf4e8ab5ba9ac

Comment by Ian Boros [ 28/May/21 ]

CC anton.korshunov

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