-
Notifications
You must be signed in to change notification settings - Fork 24
Rewrite Retry Policy #1834
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
base: main
Are you sure you want to change the base?
Rewrite Retry Policy #1834
Conversation
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
src/main/java/io/stargate/sgv2/jsonapi/service/cqldriver/CqlRetryPolicy.java
Outdated
Show resolved
Hide resolved
amorton
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is ok to merge, but we still need to understand what the router is doing
so some tweaks but we need to confirm what the router is doing next week
| import com.datastax.oss.driver.api.core.context.DriverContext; | ||
| import com.datastax.oss.driver.api.core.retry.RetryDecision; | ||
|
|
||
| /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 excellent
|
|
||
| RetryDecision retryDecision = | ||
| (retryCount < MAX_RETRIES && received >= blockFor && !dataPresent) | ||
| ? RetryDecision.RETRY_SAME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: can this do the same calling the subclass to get the retry same ? and the write timeout below
| int retryCount) { | ||
|
|
||
| final RetryDecision retryDecision = | ||
| (retryCount < MAX_RETRIES && (writeType == WriteType.CAS || writeType == WriteType.SIMPLE)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 for testing both ,
| public RetryVerdict onErrorResponseVerdict( | ||
| @NonNull Request request, @NonNull CoordinatorException error, int retryCount) { | ||
|
|
||
| // Issue1830: CASWriteUnknownException and TruncateException have been included in the default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, include link to the GH issue
|
|
||
| @Override | ||
| @Deprecated | ||
| public RetryDecision onReadTimeout( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i get why, but the Unsupported error feels a little dangerous. OK to leave but please dble check all the new methods have been implemented. Because they have default the compiler will not pickup if we miss one
What this PR does:
BaseCqlRetryPolicyis for HCD and Cassandra;AstraCqlRetryPolicyis for AstraonWriteTimeoutVerdictandonErrorResponseVerdictand change the retry times to 3.Which issue(s) this PR fixes:
Fixes #1830
Checklist