Skip to content

Cassandra: an unavailable replica set is reported as a 500 storage fault rather than a retryable 503 #593

Open

Description

@LeeroyHannigan

Summary

Every Cassandra driver error on the data path is wrapped as StorageError::Internal and reaches the client as HTTP 500 InternalServerError. Since #591 (the fix for #560), a ConsistentRead: true read, an export or an item write that cannot reach a local quorum of replicas fails this way. The repository's class for a failure that succeeds on retry is StorageError::Transient, which the engine maps to 503 ServiceUnavailable, the status the SDKs retry.

Observed

On a keyspace at replication factor 3 with one replica up:

  • GetItem with ConsistentRead: true: 500, log Get item: General error: No nodes available in query plan! (one node; the driver retried the unavailable read once and found no next node) or Cannot achieve consistency level LOCAL_QUORUM with UnavailableError { cl: LocalQuorum, required: 2, alive: 1 } (a cluster).
  • PutItem, UpdateItem: 500 with the same texts prefixed by put_item read: or occ_read:.
  • DeleteItem of an existing item and TransactWriteItems: 500 with the text Database error, which names neither the level nor the replica counts (admin_store.rs and metadata_engine.rs produce the literal; the two data paths that return it were not traced).

Expected

The driver's Unavailable error, and the No nodes available in query plan! that follows a retried Unavailable, map to StorageError::Transient, so the client receives 503 and the SDK retries. The DeleteItem and TransactWriteItems mappings carry the driver's text so the log names the level and the replica counts.

Where

  • crates/storage-cassandra/src/cassandra_util.rs (the map_err sites in execute_at, query_rows_at, query_optional_at, query_lwt)
  • crates/storage-cassandra/src/data/delete_item.rs, data/transactions.rs (the Database error mappings)
  • crates/storage/src/error.rs (StorageError::Transient)

Activity

  1. added
    backend:cassandra
    on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:cassandra

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions