Skip to content

Conversation

@Hazel-Datastax
Copy link
Contributor

@Hazel-Datastax Hazel-Datastax commented Jan 22, 2025

What this PR does:

  • Create two retry policies. BaseCqlRetryPolicy is for HCD and Cassandra; AstraCqlRetryPolicy is for Astra
  • Refine the log structure
  • Override retry logic in onWriteTimeoutVerdict and onErrorResponseVerdict and change the retry times to 3.
  • Add unit tests

Which issue(s) this PR fixes:
Fixes #1830

Checklist

  • Changes manually tested
  • Automated Tests added/updated
  • Documentation added/updated
  • CLA Signed: DataStax CLA

@Hazel-Datastax Hazel-Datastax marked this pull request as ready for review January 23, 2025 01:18
@Hazel-Datastax Hazel-Datastax requested a review from a team as a code owner January 23, 2025 01:18
Copy link
Contributor

@amorton amorton left a 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;

/**
Copy link
Contributor

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
Copy link
Contributor

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))
Copy link
Contributor

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
Copy link
Contributor

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(
Copy link
Contributor

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

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.

Retry on CASWriteUnknownException

3 participants