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

refactor(cassandra): Mark queries as idempotent to enable retries #1575

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

abhinavk96
Copy link
Contributor

@abhinavk96 abhinavk96 commented Apr 26, 2023

Pull Request checklist

  • The commit(s) message(s) follows the contribution guidelines ?
  • Tests for the changes have been added (for bug fixes / features) ?
  • Docs have been added / updated (for bug fixes / features) ?

Current behavior :
Idempotence is not explicitly set on any prepared statements for the queries.

Datastax specifies that by default queries are not marked as idempotent unless overridden at the session level.
Because of this the queries won't be retried according to the retry policy.

Reference: https://docs.datastax.com/en/developer/java-driver/3.6/manual/idempotence/#query-idempotence
Quote from above:

Idempotence matters for retries and speculative query executions. The driver will bypass those features if the Statement#isIdempotent() flag is set to false, to ensure that the statement does not get executed more than once.
In most cases, you must set that flag manually.

New behavior :
Setting idempotent explicitly to true will enable the retry policy to act on these queries.

Note:
The queries have all been deemed to be idempotent. Please review individual queries carefully to verify that assertion.

@vishramachandran vishramachandran self-requested a review May 5, 2023 16:53
Copy link
Member

@vishramachandran vishramachandran left a comment

Choose a reason for hiding this comment

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

LGTM

amolnayak311
amolnayak311 previously approved these changes May 10, 2023
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.

3 participants