-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Aggs: Add real memory CB call when building internal aggregators in buckets #116329
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
Aggs: Add real memory CB call when building internal aggregators in buckets #116329
Conversation
Pinging @elastic/es-analytical-engine (Team:Analytics) |
server/src/main/java/org/elasticsearch/search/aggregations/bucket/BucketsAggregator.java
Outdated
Show resolved
Hide resolved
* memory in the parent breaker and break the execution if we are running out. | ||
* To achieve that, we are passing 0 as the estimated bytes every 1024 calls | ||
*/ | ||
private void updateCircuitBreaker(String label) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add parent in the method name so it is clear the purpose? like checkParentCircuitBreaker
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand what do we mean by "parent" here. We're updating the current CB. Parent of what?
That copied javadoc says parent too, but I'm not sure what it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have different circuit breakers with different thresholds. All those circuit breakers are below another breaker that is called the parent. In the past, the parent circuit breaker was a global threshold, so even if all CBs did not hit their individual threshold, summing them up will hit a global threshold (the threshold of the parent) and then the request would trip.
More recently, we introduced the real memory CB which replaced the parent circuit breaker (you can disable the real memory CB and you get the old behaviour). In this case, instead of checking a global threshold, we check the actual memory usage and will trip if we are over a threshold after trying to free some heap,
Therefore adding 0 bytes to the CB only has effect if we check the real memory, otherwise is a NOOP.
server/src/main/java/org/elasticsearch/search/aggregations/bucket/BucketsAggregator.java
Outdated
Show resolved
Hide resolved
@elasticmachine update branch |
…uckets (elastic#116329) Related with elastic#88128 This PR pretends to reduce the potential OOMs received when building internal aggregations.
💚 Backport successful
|
…uckets (elastic#116329) Related with elastic#88128 This PR pretends to reduce the potential OOMs received when building internal aggregations.
…uckets (elastic#116329) Related with elastic#88128 This PR pretends to reduce the potential OOMs received when building internal aggregations.
Related with #88128
This PR pretends to reduce the potential OOMs received when building internal aggregations.