-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Fully Compatible
-
ALL
-
QE 2022-04-18
When a replan occurs, a string field called "replanReason" is supposed to appear in the log and in system.profile. This is broken if there is a $group or $lookup pushed down to SBE. You can reproduce this with the same repro script that I wrote for related ticket SERVER-65197.
After some digging, I was able to spot that the problem occurs here:
Imagine that a replan occurs, and the system uses the SBE multi-planner to select a new plan. The "replanReason" string is present in PlanStageData::replanReason, and each candidate plan has an associated PlanStageData object.
When a $group or $lookup has been pushed down, the multi-planner selects a plan and then creates an entirely new SBE tree after calling extendWithAggPipeline(). This process currently drops the old PlanStageData object and creates a fresh one. As a result, we discard the value of "replanReason". When the downstream code responsible for displaying "replanReason" in the logs and profile executes, it finds no value and therefore displays nothing.
- is related to
-
SERVER-65197 Query with $lookup pushed down to SBE can get repeatedly replanned
- Closed