-
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
Merged
ivancea
merged 5 commits into
elastic:main
from
ivancea:bucket-aggs-real-memory-break-internal
Nov 7, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
57c0b6e
Add circuit breaker call on buckets aggregator internal aggs building
ivancea 9794d58
Format
ivancea 48f29d9
Moved CB check inside loop
ivancea 9165205
Updated javadocs and called CB before building aggs
ivancea 620d8a8
Merge branch 'main' into bucket-aggs-real-memory-break-internal
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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.