-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Overview
SortExecutor (src/mongo/db/exec/sort_executor.h) has a legacy constructor that takes a raw uint64_t maxMemoryUsageBytes and forwards a null OperationContext to the primary constructor. Because the limit is a fixed value, the null opCtx is never consulted, but it prevents these call sites from ever using a knob-backed MemoryUsageLimit that resolves against the operation's QueryKnobConfiguration.
Introduced in SERVER-131007 (https://github.com/10gen/mongo/pull/58124). Threading the opCtx was deferred there to avoid call-site churn outside query-owned code (e.g. index build sorters).
Suggested work
* Add an OperationContext* parameter to the legacy constructor and update its call sites, or migrate the call sites to the primary constructor and delete the legacy one.
* Remove the TODO referencing this ticket in sort_executor.h.