-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
None
-
None
-
None
-
None
-
None
-
None
-
None
When a query exceeds the per-operation memory limit during expression evaluation, the ExceededMemoryLimit error is thrown from SimpleMemoryUsageTracker::assertWithinMemoryLimit(). The thrown message names the expression that crossed the threshold and reports the needed bytes plus the full local/level/global limit cascade — but it does not identify the stage the expression was running in, and there is no ERROR log recording it. Operators currently cannot tell from the logs which stage was responsible for a memory-limit failure.
1. Add a StringData stageName field to EvaluationContext. Stages that evaluate expressions with a memory tracker set it to their source name when constructing the context.
2. Add an optional stageName parameter to SimpleMemoryUsageTracker::assertWithinMemoryLimit(StringData name, StringData stageName = {}) and include it in the error message
3. Report a LOGV2_ERROR with the message