Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Account for TransportMultiSearchAction's response array in Circuit Breaker #32051

Closed
polyfractal opened this issue Jul 13, 2018 · 6 comments
Closed
Labels
>enhancement :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@polyfractal
Copy link
Contributor

polyfractal commented Jul 13, 2018

TransportMultiSearchAction has an AtomicArray that is used to collect individual search responses as they finish executing. When the last request finishes, the results in the array are packaged into a MultiSearchResponse and sent back to the client.

If the multi-search involves a large number of shards, or the responses are very large, or there are many multi-searches in parallel (or all three)... this seems like a prime candidate for causing an OOM on smaller heaps.

I don't believe we track this array in any circuit breaker explicitly, and since it is holding finished results it isn't subject to any breakers in place for the search phase. If the responses come back to the coordinating node in a staggered manner it is unlikely to trip the in-flight breaker either.

It would be nice if we could account for this array in the Request breaker somehow. I imagine the tricky bit is estimating how big the various SearchResponse are (or Exception in the case of failures). @dakrone suggested maybe selecting n responses and averaging their size to use as a heuristic.

Tagging both Core/CB and Search because I'm indecisive...sorry! :)

@polyfractal polyfractal added >enhancement :Search/Search Search-related issues that do not fall into other categories :Core/Infra/Circuit Breakers Track estimates of memory consumption to prevent overload labels Jul 13, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search-aggs

@altinp
Copy link

altinp commented Feb 4, 2020

It's not just multi-search, even one (sizable) search request (i.e. via TransportSearchAction) against many shards can cause an OOM. This is easily reproducible from at least 5.6-7.4, instantly so if logging to file/console is turned off.
#48910

@rjernst rjernst added Team:Core/Infra Meta label for core/infra team Team:Search Meta label for search team labels May 4, 2020
@rjernst rjernst added the needs:triage Requires assignment of a team area label label Dec 3, 2020
@rjernst
Copy link
Member

rjernst commented Dec 9, 2020

While this issue involves circuit breakers, it is in fact just about a particular use of circuit breakers, but not the circuit breaker infrastructure. So I am removing the core/infra label and leaving to to the search team to implement/manage as they see fit.

@rjernst rjernst removed :Core/Infra/Circuit Breakers Track estimates of memory consumption to prevent overload needs:triage Requires assignment of a team area label labels Dec 9, 2020
@elasticmachine elasticmachine removed the Team:Core/Infra Meta label for core/infra team label Dec 9, 2020
@javanna javanna added :Search Foundations/Search Catch all for Search Foundations and removed :Search/Search Search-related issues that do not fall into other categories labels Jul 17, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 17, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine elasticsearchmachine removed the Team:Search Meta label for search team label Jul 17, 2024
@javanna
Copy link
Member

javanna commented Mar 21, 2025

This issue has been opened for a very long time, we haven't followed up on addressing it and we don't have plans on doing so for the time being. There has also been focus on memory management and circuit breaking in case of memory pressure, in the context of each search request.

@javanna javanna closed this as not planned Won't fix, can't repro, duplicate, stale Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

6 participants