[FLINK-38499][runtime] Limit max sleep time in Curator for Zookeeper HA #27104
+23
−6
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.
What is the purpose of the change
https://issues.apache.org/jira/browse/FLINK-38499
Currently, the Curator framework used by ZK based HA is using the exponential backoff retry policy. However, the max sleep time is unbounded. That could cause unbounded sleep time when the retryCount is large. When that happens, recovery from ZK issues may be unreasonably slow.
In my day job, we have a critical patch that limits the max sleep time after seeing multiple ZK issues in the past. In other Apache projects, the BoundedExponentialBackoffRetry is widely used, such as fluss, druid, hudi, bookeeper, phoeniex to name a few.
This Jira proposes to limit the max sleep time by leveraging BoundedExponentialBackoffRetry, with a pretty high default value for starters. Users can change this via a new config option.
Brief change log
high-availability.zookeeper.client.max-retry-wait
ZooKeeperUtils
Verifying this change
Updated existing tests. Ported from internally tested patch.
Does this pull request potentially affect one of the following parts:
@Public(Evolving)
: (yes / no)Documentation