Cassandra: Query answers 500 on a partition whose items were all deleted
メンテナーはふだん 4 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
crates/storage-cassandra/src/data/query.rs から始めてください。結果ループは cassandra_util::get_column(&row, "item_data", "query parse")? を呼び出しており、delete_item.rs が残した静的データのみの行で失敗します。そこでは item_data が null の行をスキップし、Scan の読み取りにも同じループがあるかを確認してください。完全に削除されたパーティションに対する Query が、ConsistentRead の有無にかかわらず Count: 0 を返すことを、tests/ にあるデュアルターゲットテストで示せば完了です。
索引モデルが issue の本文から書いたものです。
説明
On the Cassandra backend, a Query whose partition key names a partition that held items, all of which have since been deleted, answers 500 InternalServerError instead of an empty result. Amazon DynamoDB answers 200 with Count: 0.
Reproduction
A table with a hash key pk (S) and a range key sk (S), on a local Cassandra 4.1 node:
PutItem{"pk": "a", "sk": "1"}.Querywithpk = :p,:p = "a":Count: 1.DeleteItem{"pk": "a", "sk": "1"}.- The same
Query, withConsistentReadfalse and true: both answer500 {'Code': 'InternalServerError', 'Message': 'Internal server error'}.
A conditional delete (attribute_exists(pk)) in step 3 gives the same result. The server logs:
ERROR extenddb_storage_cassandra::cassandra_util: query parse parse column 'item_data': General error: Column or Udt property 'item_data' is empty
Where
crates/storage-cassandra/src/data/delete_item.rs writes partition_max_delete_timestamp before it deletes the row (update_partition_max_delete_timestamp_at). On a table with a sort key that column is STATIC (ddl.rs), so once the last item is gone the partition still holds a row with only the static column set. The Query path in crates/storage-cassandra/src/data/query.rs reads item_data from every row it gets back with cassandra_util::get_column(&row, "item_data", "query parse")?, which fails on that static-only row.
Seen on main (5ff323beb) and on the branch of #424; the reproduction above was run against the #424 branch.
Suggested fix
Skip rows whose item_data is null in the Query (and Scan, if it has the same read) result loop, as rows with no item, rather than failing the request.
Test
A dual-target test in tests/ that puts one item, deletes it and asserts that a Query of its partition answers Count: 0, with and without ConsistentRead.
- 主要言語
- Rust
- スター
- 517
- フォーク
- 60
- 平均マージ
- 5日 1時間
- マージ済み PR(30日)
- 67
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ExtendDB/extenddb のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 4 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 4 日以内に返信
-
server: console user and role deletes leave the cached creation time対応中かも @LeeroyHannigan が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
ExtendDB/extenddb#787 · 担当者 1 名 ·
メンテナーはふだん 4 日以内に返信
-
bug security
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 4 日以内に返信
ExtendDB/extenddb の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
nervosnetwork/fiber#1723 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 69/100
メンテナーはふだん 1 日以内に返信
-
needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 71/100
pbakaus/impeccable#1314 ·
メンテナーはふだん 1 日以内に返信
-
marmite skill: `curl ... | sh` is the first install method, bypassing review and integrity checksオープン
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
rochacbruno/marmite#565 ·