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.
This PR implements a modified approach to circuit breaking in Elasticsearch. The goal is to enhance the parent circuit breaker mechanism by ensuring it only triggers during aggregation-based search queries. The changes involve identifying specific labels associated with aggregation requests and introducing a new cluster setting to control this modified behavior.
Key Changes
1. Label Identification for Aggregation Requests
[agg]
Prefix: Certain labels that indicate aggregation-based queries have been prefixed with[agg]
. This helps in identifying whether the circuit breaker should consider these labels when deciding to trip.<reduce_aggs>
to[agg]<reduce_aggs>
preallocate[...]
to[agg]preallocate[...]
<reused_arrays>
to[agg]<reused_arrays>
<agg [name]>
to[agg]<agg [name]>
allocated_buckets
to[agg]allocated_buckets
2. New Cluster Setting
indices.breaker.total.use_modified_circuit_breaker
, has been introduced. This setting allows enabling or disabling the modified circuit breaking approach dynamically.false
3. Consumer Method for Setting Updates
4. HierarchyCircuitBreaker Check
HierarchyCircuitBreakerService
, when checking if the circuit should be broken, the code now also checks the value of the new setting and the label prefix. The circuit will only break if the setting is enabled and the label has the[agg]
prefix.Configuration