elasticsearch/docs/changelog/121920.yaml
Andrei Dan 760b2312ea
Periodically check the available memory when fetching search hits source (#121920)
When fetching documents, sometimes we need to load the  entire source of
search hits. Document sources can be large,  and with support for up to
10k hits per search request, this creates  a significant untracked
memory load on Elasticsearch that can  potentially cause out-of-memory
errors.

This PR adds memory checking for hits source in the fetch phase. We
check with the parent (the real memory) circuit breaker every  1MiB of
loaded source and when fetching the last document of every segment. This
gives the real memory breaker a chance to interrupt  running operations
when we're running low on memory, and prevent  potential OOMs. 

The amount of local accounting to buffer is controlled by the 
`search.memory_accounting_buffer_size` dynamic setting and defaults to
`1MiB`.

Fixes #89656
2025-02-25 03:25:14 +11:00

6 lines
122 B
YAML

pr: 121920
summary: Account for the `SearchHit` source in circuit breaker
area: Search
type: enhancement
issues:
- 89656