-
Type: Bug
-
Resolution: Gone away
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
ALL
-
QE 2021-12-27, QE 2022-01-10, QE 2022-02-07, QE 2022-01-24, QE 2023-02-20, QE 2023-03-06, QE 2023-03-20, QE 2023-04-03
A number of stages track whether their child is open via a _childOpened boolean flag. This flag is usually set after calling open() on the child. For example:
// From FilterStage. void open(bool reOpen) final { // <Other logic omitted> _children[0]->open(reOpen);// This might throw! _childOpened = true; }
Unfortunately, a call to open() may throw, in order to abort a trial period. If this happens, the stage's _childOpened flag is never set to true. This means that a call to close() on the parent stage will not result in the child stage being closed.
// FilterStage. void close() final { // <Omitted> if (_childOpened) { // This branch isn't taken if the exception is thrown on open(). _children[0]->close(); _childOpened = false; } }
In other words, after the exception is thrown, even closing() and opening() the plan leaves the tree in an invalid state. Attempting to use the plan may result in a server crash.
We should do a full audit of all of the SBE stages and make sure this pattern is fixed in every case. Here are the two places I've encountered it:
- depends on
-
SERVER-61422 Update SBE filter stage builder to use parameter markers
- Closed
- related to
-
SERVER-67630 [SBE] SortStage is not guaranteed to close its child branches during multiplanning
- Closed