Skip to content

Conversation

dkropachev
Copy link

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

@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);

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
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

Comment on lines +469 to +471
startedSpeculativeExecutionsCount.incrementAndGet();
// Note that `node` is the first node of the execution, it might not be the
// "slow" one if there were retries, but in practice retries are rare.
Copy link

@Bouncheck Bouncheck Mar 31, 2025

Choose a reason for hiding this comment

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

I don't understand why speculative executions count is increased here. Is this method only for SpecEx queries?

@dkropachev dkropachev force-pushed the scylla-4.x branch 2 times, most recently from 0666b08 to de10f2f Compare April 8, 2025 16:53
@dkropachev dkropachev marked this pull request as draft April 22, 2025 04:22
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