Click or drag to resize

DefaultRetryPolicy Methods

The DefaultRetryPolicy type exposes the following members.

Methods
  NameDescription
Public methodOnReadTimeout
Defines whether to retry and at which consistency level on a read timeout.

This method triggers a maximum of one retry, and only if enough replica had responded to the read request but data was not retrieved amongst those. Indeed, that case usually means that enough replica are alive to satisfy the consistency but the coordinator picked a dead one for data retrieval, not having detected that replica as dead yet. The reasoning for retrying then is that by the time we get the timeout the dead replica will likely have been detected as dead and the retry has a high change of success.

Public methodOnRequestError
The default implementation triggers a retry on the next host in the query plan with the same consistency level, regardless of the statement's idempotence, for historical reasons.
Public methodOnUnavailable
Defines whether to retry and at which consistency level on an unavailable exception.

This method never retries as a retry on an unavailable exception using the same consistency level has almost no change of success.

Public methodOnWriteTimeout
Defines whether to retry and at which consistency level on a write timeout.

This method triggers a maximum of one retry, and only in the case of a WriteType.BATCH_LOG write. The reasoning for the retry in that case is that write to the distributed batch log is tried by the coordinator of the write against a small subset of all the node alive in the local datacenter. Hence, a timeout usually means that none of the nodes in that subset were alive but the coordinator hasn't' detected them as dead. By the time we get the timeout the dead nodes will likely have been detected as dead and the retry has thus a high change of success.

Top
See Also