ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Server
  • Cloud
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Download
ScyllaDB Docs Scylla C/C++ Driver API Documentation CassRetryPolicy

CassRetryPolicy¶

struct CassRetryPolicy¶

Public Functions

CassRetryPolicy *cass_retry_policy_default_new()¶

Creates a new default retry policy.

This policy retries queries in the following cases:

  • On a read timeout, if enough replicas replied but data was not received.

  • On a write timeout, if a timeout occurs while writing the distributed batch log

  • On unavailable, it will move to the next host

In all other cases the error will be returned.

This policy always uses the query’s original consistency level.

See also

cass_retry_policy_free()

Returns:

Returns a retry policy that must be freed.

CassRetryPolicy *cass_retry_policy_downgrading_consistency_new()¶

Creates a new downgrading consistency retry policy.

Important: This policy may attempt to retry requests with a lower consistency level. Using this policy can break consistency guarantees.

This policy will retry in the same scenarios as the default policy, but it will also retry in the following cases:

  • On a read timeout, if some replicas responded but is lower than required by the current consistency level then retry with a lower consistency level.

  • On a write timeout, Retry unlogged batches at a lower consistency level if at least one replica responded. For single queries and batch if any replicas responded then consider the request successful and swallow the error.

  • On unavailable, retry at a lower consistency if at lease one replica responded.

This goal of this policy is to attempt to save a request if there’s any chance of success. A writes succeeds as long as there’s a single copy persisted and a read will succeed if there’s some data available even if it increases the risk of reading stale data.

Deprecated:

This still works, but should not be used in new applications. It can lead to unexpected behavior when the cluster is in a degraded state. Instead, applications should prefer using the lowest consistency level on statements that can be tolerated by a specific use case.

See also

cass_retry_policy_free()

Returns:

Returns a retry policy that must be freed.

CassRetryPolicy *cass_retry_policy_fallthrough_new()¶

Creates a new fallthrough retry policy.

This policy never retries or ignores a server-side failure. The error is always returned.

See also

cass_retry_policy_free()

Returns:

Returns a retry policy that must be freed.

CassRetryPolicy *cass_retry_policy_logging_new(CassRetryPolicy *child_retry_policy)¶

Creates a new logging retry policy.

This policy logs the retry decision of its child policy. Logging is done using CASS_LOG_INFO.

See also

cass_retry_policy_free()

Parameters:

child_retry_policy – [in]

Returns:

Returns a retry policy that must be freed. NULL is returned if the child_policy is a logging retry policy.

void cass_retry_policy_free(CassRetryPolicy *policy)¶

Frees a retry policy instance.

Parameters:

policy – [in]

Was this page helpful?

PREVIOUS
CassResult
NEXT
CassRow
  • Create an issue
  • Edit this page

On this page

  • CassRetryPolicy
    • CassRetryPolicy
      • CassRetryPolicy::cass_retry_policy_default_new()
      • CassRetryPolicy::cass_retry_policy_downgrading_consistency_new()
      • CassRetryPolicy::cass_retry_policy_fallthrough_new()
      • CassRetryPolicy::cass_retry_policy_logging_new()
      • CassRetryPolicy::cass_retry_policy_free()
Scylla C/C++ Driver
  • master
    • master
  • C/C++ Driver for ScyllaDB
  • API Documentation
    • CassAggregateMeta
    • CassAuthenticator
    • CassAuthenticatorCallbacks
    • CassBatch
    • CassCluster
    • CassCollection
    • CassColumnMeta
    • CassCustomPayload
    • CassDataType
    • CassErrorResult
    • CassExecProfile
    • CassFunctionMeta
    • CassFuture
    • CassIndexMeta
    • CassInet
    • CassIterator
    • CassKeyspaceMeta
    • CassLogMessage
    • CassMaterializedViewMeta
    • CassMetrics
    • CassNode
    • CassPrepared
    • CassResult
    • CassRetryPolicy
    • CassRow
    • CassSchemaMeta
    • CassSession
    • CassSpeculativeExecutionMetrics
    • CassSsl
    • CassStatement
    • CassTableMeta
    • CassTimestampGen
    • CassTuple
    • CassUserType
    • CassUuid
    • CassUuidGen
    • CassValue
    • CassVersion
    • DseDateRange
    • DseDateRangeBound
    • DseLineString
    • DseLineStringIterator
    • DsePolygon
    • DsePolygonIterator
  • Features
    • Basics
      • Batches
      • Binding Parameters
      • Client-side timestamps
      • Consistency
      • Data Types
      • The date and time Types
      • Futures
      • Handling Results
      • Keyspaces
      • Prepared Statements
      • Schema Metadata
      • Tuples
      • User-Defined Types (UDTs)
      • UUIDs
    • Building
    • Client Configuration
    • Cloud
    • Configuration
      • Retry policies
    • Execution Profiles
    • FAQ
    • Installation
    • Logging
    • Metrics
    • Scylla Specific Features
    • Security
      • SSL
    • Testing
      • Cassandra Cluster Manager (CCM)
    • Tracing
  • DSE Features
    • Authentication
    • Geospatial types
Docs Tutorials University Contact Us About Us
© 2025, ScyllaDB. All rights reserved. | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 28 April 2025.
Powered by Sphinx 7.4.7 & ScyllaDB Theme 1.8.6