question

rajib76 avatar image
rajib76 asked alexandre.dutra commented

Does the default retry policy ensure non-idempotent operations are not retried?

Does the default retry policy in the Datastax java driver ensures that retry should not happen for non-idempotent operations(for example updating a count)?

java driver
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

alexandre.dutra avatar image
alexandre.dutra answered alexandre.dutra commented

Yes.

This is covered in the manual.

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

rajib76 avatar image rajib76 commented ·

Thanks Alexandre, the documentation says

What to do when a request failed on a node: retry (same or other node), rethrow, or ignore.

  • advanced.retry-policy in the configuration. Default policy retries at most once, in cases that have a high chance of success; you can also write your own.
  • can have per-profile policies.
  • only kicks in if the query is idempotent.

So, this means the retry will kick in only for idempotent queries irrespective of what retry policy we have(includes custom retry policy also)

Thanks

0 Likes 0 ·
alexandre.dutra avatar image alexandre.dutra ♦ rajib76 commented ·

Yes, the retry policy is not even consulted if the statement isn't idempotent. You can have a look at the code if you are unsure; e.g. here is what happens if a write timeout occurs.

0 Likes 0 ·