Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

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

未关闭
#593 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 4 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
70/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
cassandra, rust
领域
backend, database

调研方向

Start with the map_err sites in crates/storage-cassandra/src/cassandra_util.rs and the Database error mappings in data/delete_item.rs and data/transactions.rs; read crates/storage/src/error.rs to understand StorageError::Transient. Check how the Cassandra driver represents unavailable replicas and exhausted query plans. Done when these failures map to the retryable storage error, while delete and transaction logs retain the driver's error details.

由索引模型根据 Issue 内容生成。

描述

backend:cassandra

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)
主要语言
Rust
星标
517
派生
60
平均合并
4 天 10 小时
30 天内合并 PR
37

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ExtendDB/extenddb 的其他 Issue

查看 ExtendDB/extenddb 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。