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

4.x: Introduce exponential retry backoff policy #483

Open
wants to merge 1 commit into
base: scylla-4.x
Choose a base branch
from

Conversation

dkropachev
Copy link
Collaborator

Make driver wait before retry.
It is needed to mitigate retry storms that can happen in certain cases.

Fixes: #481

@dkropachev dkropachev requested a review from Bouncheck March 25, 2025 23:44
@dkropachev dkropachev force-pushed the dk/4.x-add-exponential-retry-backoff-policy branch 5 times, most recently from 798c52b to ba056bb Compare March 26, 2025 00:37
Make driver wait before retry.
It is needed to mitigate retry storms that can happen in certain cases.
@dkropachev dkropachev force-pushed the dk/4.x-add-exponential-retry-backoff-policy branch from ba056bb to af7f1b3 Compare March 26, 2025 02:19
Copy link
Collaborator

@Bouncheck Bouncheck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation in multiple places is not adjusted to describe the new implementations. Often it refers to other existing classes or interfaces and does not list newly added params.

Is it necessary to introduce a new separate category of retry policies? I think from the user perspective it may be hard to understand how does the RetryPolicy interact with BackOffRetryPolicy.
Ideally the new retry policy should be just an implementation of RetryPolicy interface.

Comment on lines +202 to +215
/** The class of the retry policy. */
public static final TypedDriverOption<String> BACKOFF_RETRY_POLICY_CLASS =
new TypedDriverOption<>(DefaultDriverOption.BACKOFF_RETRY_POLICY_CLASS, GenericType.STRING);
/** The class of the retry policy. */
public static final TypedDriverOption<Integer> BACKOFF_RETRY_BASE_BACKOFF_MS =
new TypedDriverOption<>(
DefaultDriverOption.BACKOFF_RETRY_BASE_BACKOFF_MS, GenericType.INTEGER);
/** The class of the retry policy. */
public static final TypedDriverOption<Integer> BACKOFF_RETRY_MAX_BACKOFF_MS =
new TypedDriverOption<>(
DefaultDriverOption.BACKOFF_RETRY_MAX_BACKOFF_MS, GenericType.INTEGER);
/** The class of the retry policy. */
public static final TypedDriverOption<Double> BACKOFF_RETRY_JITTER_RATIO =
new TypedDriverOption<>(DefaultDriverOption.BACKOFF_RETRY_JITTER_RATIO, GenericType.DOUBLE);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Descriptions here look incorrect

@dkropachev
Copy link
Collaborator Author

Documentation in multiple places is not adjusted to describe the new implementations. Often it refers to other existing classes or interfaces and does not list newly added params.

Is it necessary to introduce a new separate category of retry policies? I think from the user perspective it may be hard to understand how does the RetryPolicy interact with BackOffRetryPolicy. Ideally the new retry policy should be just an implementation of RetryPolicy interface.

It is definitely easier, I will try to make it part of regular retry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4.x: Introduce exponential retry backoff policy
2 participants