-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Description
The current memory handling in the fetch phase and during multi-search accumulation does not fully utilize the reference-counted lifecycle of SearchHit.
As a result, memory used by hits is not consistently tracked by the request circuit breaker, and large fetch results or large multi-search responses can accumulate without proper accounting.
Additionally, the fetch phase still returns results as a single large payload rather than chunking, which increases peak memory usage and limits Elasticsearch’s ability to protect itself from large responses.
This issue tracks the core changes needed to improve stability and ensure predictable, safe memory behavior in fetch and multi-search operations:
-
Adapt the memory accounting in the FetchPhase to follow the lifecycle of the ref-counted
SearchHit.
(This ensures memory is correctly accounted on the coordinating node and during multi-search accumulation) -
Revise the request circuit breaker limit for small heaps to provide safer headroom for large fetch responses.
-
Chunk FetchPhase results instead of producing a single large blob, reducing peak memory usage and enabling safer coordination behavior. ([WIP] Implement chunked fetch streaming with circuit breaker integration #139124)