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

Don't Circuit Break Recovery Requests #46059

Conversation

original-brownbear
Copy link
Member

@original-brownbear original-brownbear commented Aug 28, 2019

Problem

Recovery requests are likely to trip the cirucit breaker under heavy load
which might lead to unfortunate side-effects in nodes under pressure.
A node temporarily under high load will be less likely to fail recovery
leading to permanent changes in allocation.
Moreover, the requests sent by the recovery mechanism are all bound in
byte size by design. If they are sent in rapid succession then the memory
used by strong references to them will be bounded but the memory used
by unreferenced objects that resulted from them could heavily fluctuate.
This makes the real-memory circuit breaker's memory use estimation
that does not account for GC particularly inefficient when it comes to
recoveries (#40115).

Solution

Turn off the circuit breaker for recoveries. Users have other means of
limiting the memory use of recoveries by setting the recovery chunk
size and parallelism. Given the bounded amount of memory used by
recoveries a user can either lower the amount of resources allocated
to recoveries in the settings or adjust the real-memory circuit breaker
limits slightly to account for this change.
I think its a fair assumption that the number of clusters that would
see nodes running out of memory as a result of this change is small.
Also it would be a subset of those clusters that currently see recovery
failures as a result of the circuit breaker and those should be fixed
regardless.

Unfortunately, I don't think we can use the same solution for the
case of replication requests tripping the circuit breaker as those
are not naturally bounded in size.

Relates #44484
Example of the user impact: https://discuss.elastic.co/t/7-0-1-new-circuitbreaker-segment-bigger-than-heap-should-this-break/195455

Recovery requests are likely to trip the cirucit breaker under heavy load
which might lead to unfortunate side-effects in nodes under pressure.
A node temporarily under high load will be less likely to fail recovery
leading to permanent changes in allocation.
Moreover, the requests sent by the recovery mechanism are all bound in
byte size by design. If they are sent in rapid succession then the memory
used by strong references to them will be bounded but the memory used
by unreferenced objects that resulted from them could heavily fluctuate.
This makes the real-memory circuit breaker's memory use estimation
that does not account for GC particularly inefficient when it comes to
recoveries (elastic#40115).

Turn off the circuit breaker for recoveries. Users have other means of
limiting the memory use of recoveries by setting the recovery chunk
size and parallelism. Given the bounded amount of memory used by
recoveries a user can either lower the amount of resources allocated
to recoveries in the settings or adjust the real-memory circuit breaker
limits slightly to account for this change.
I think its a fair assumption that the number of clusters that would
see nodes running out of memory as a result of this change is small.
Also it would be a subset of those clusters that currently see recovery
failures as a result of the circuit breaker and those should be fixed
regardless.

Unfortunately, I don't think we can use the same solution for the
case of replication requests tripping the circuit breaker as those
are not naturally bounded in size.

Relates elastic#44484
@original-brownbear original-brownbear added >non-issue :Distributed Indexing/Recovery Anything around constructing a new shard, either from a local or a remote source. team-discuss v8.0.0 v7.4.0 labels Aug 28, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@colings86 colings86 added v7.5.0 and removed v7.4.0 labels Aug 30, 2019
@original-brownbear
Copy link
Member Author

We discussed this during our team meeting and decided that this isn't a safe approach to handling this issue due to the shard resulting from the recovery not requiring a fixed or predictable amount of segment memory and that we would like a more wholistic solution to the problem of the circuit breaker tripping over important network messages like the ones involved here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed Indexing/Recovery Anything around constructing a new shard, either from a local or a remote source. >non-issue team-discuss v7.5.0 v8.0.0-alpha1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants