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)?
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)?
Yes.
This is covered in the manual.
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.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
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.
8 People are following this question.
How can I enable Speculative query execution in Java without using configuration files?
InvalidTypeException: class java.time.LocalDateTime does not correspond to any CQL3 type
Using EntityMapper and java.util.Optional<> fields on Immutable Entities
How can I use the IN() operator with the Java driver mapper?
What is the difference between CqlSession and Cluster object in the Java driver?
DataStax Enterprise is powered by the best distribution of Apache Cassandra ™
© 2023 DataStax, Titan, and TitanDB are registered trademarks of DataStax, Inc. and its subsidiaries in the United States and/or other countries.
Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries.
Privacy Policy Terms of Use