Configuring the retry policy

You can increase Cassandra's fault tolerance by configuring how many times you want to retry queries that have failed. By retrying a failed Cassandra query you can circumvent temporary issues, for example, network-related errors.

Note: Change the default settings only if the default Cassandra retry policy does not work for you, for example, if you have a large number of network-related errors and, in effect, a large number of failed queries.

A query might fail due to network connectivity issues or when a Cassandra node fails or becomes unreachable. By default, the DataStax driver uses a defined set of rules to determine if and how to retry queries. For more information about the default Cassandra retry policy, see the Apache Cassandra documentation.

Configure the retry policy by editing the corresponding prconfig.xml settings.

For more information about specifying settings through the prconfig.xml file, see Changing node settings by modifying the prconfig.xml file.

  1. Configure the retry policy for failed Cassandra queries:
    • To use the retry policy provided by Apache Cassandra, set the dnode/cassandra_custom_retry_policy property to false.
      Note: This is the default setting for retrying Cassandra queries.
    • To retry each query that fails, set the dnode/cassandra_custom_retry_policy property to true.
      Note: Retrying each failed query might have a negative impact on performance.
  2. If you set the dnode/cassandra_custom_retry_policy property to true in step 1, specify how many times you want to retry a failed query by setting the dnode/cassandra_custom_retry_policy/retryCount to the number of retries for a node.
    Note: The default number of retries for a node is 1. A high number of retries might have a negative impact on performance.