Cassandra: Query answers 500 on a partition whose items were all deleted
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 75/100
Direzione di ricerca
Inizia da crates/storage-cassandra/src/data/query.rs, dove il ciclo dei risultati chiama cassandra_util::get_column(&row, "item_data", "query parse")? e fallisce sulla riga solo statica lasciata da delete_item.rs. Salta lì le righe il cui item_data è null e verifica se la lettura Scan ha lo stesso ciclo. È completato quando una Query su una partizione completamente eliminata restituisce Count: 0 con e senza ConsistentRead, dimostrato da un test a doppio target in tests/.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 517
- Fork
- 60
- Merge medio
- 5g 1h
- PR unite (30g)
- 67
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di ExtendDB/extenddb
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 4 giorni
-
server: console user and role deletes leave the cached creation timeForse già presa @LeeroyHannigan l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ExtendDB/extenddb#787 · 1 assegnatario ·
I maintainer di solito rispondono entro 4 giorni
-
bug security
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di ExtendDB/extenddb
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
nervosnetwork/fiber#1723 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
I maintainer di solito rispondono entro 1 giorno
-
needs triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 71/100
pbakaus/impeccable#1314 ·
I maintainer di solito rispondono entro 1 giorno
-
marmite skill: `curl ... | sh` is the first install method, bypassing review and integrity checksAperta
Difficoltà 1/5 1-3 ore Idoneità per principianti 78/100
rochacbruno/marmite#565 ·