You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cassandra: four catalog and queue metadata reads on the data path run at LOCAL_ONE and feed a write or a cleanup #592
Four reads of catalog and queue metadata on the Cassandra data path run at LOCAL_ONE and feed a write or a cleanup. Each can miss a row written moments earlier at LOCAL_QUORUM on a keyspace with a replication factor above 1. None changes what a base-table GetItem, Query or Scan with ConsistentRead: true returns, so they were left out of #560 (fixed in #591).
The four reads
Read
File
Feeds
A missed row means
fetch_indexes_for_table on the put, update and delete paths
a write after an UpdateTable that added a GSI writes no index row for the item; if the backfill already passed its range, the GSI never holds the item
the gsi_pendinglast_ready_at read
data/index.rs
the clamp ready_at_ms = max(jittered, last_ready_at + 1) that orders async GSI mutations
a later mutation of the same worker partition can take an earlier ready_at, so the GSI can end on the older image
delete_indexes_for_table
data/index.rs
the index ids whose data tables DeleteTable drops
an index's data table is left undropped after its catalog rows are deleted
the TTL bucket read in clear_ttl_entries
data/ttl.rs
the queue partitions deleted when TTL is disabled
queue rows left behind after the registration is removed
The write paths also read the TTL configuration through ttl_config_for_table (metadata_engine.rs), which runs through cassandra_util::query_rows at the driver default outside data/; a write that misses a TTL just enabled inserts no expiration entry.
Expected
The gsi_pending read decides a write and the rows it reads are written at LOCAL_QUORUM inside data/, so passing true there closes it in one argument. The other three read catalog rows that CreateTable and UpdateTable write at the driver default outside data/, so a quorum read alone does not intersect those writes; the catalog writes need a stated level first.
#945 fixes this issue. When #945 merges, this issue can close.
#945 makes every read and write in the Cassandra backend run at LOCAL_QUORUM, and conditional statements run with Paxos at LOCAL_SERIAL. The level comes from one place, cassandra_util.rs. The consistency_policy test fails when a statement does not use it.
Each read in this issue now runs at LOCAL_QUORUM, through query_rows:
The issue also says the catalog writes in create_table.rs and update_table.rs need a stated level first. #945 sets that level. The plain catalog writes and the indexes batch run at LOCAL_QUORUM, and the tables insert is an LWT at LOCAL_SERIAL. A quorum read now overlaps each quorum write, so each read sees the row.
ttl_config_for_table still keeps its 5-second cache from main. #945 does not change that cache. The TTL audit re-registers items that a write misses while the cache is stale.
bulk_load in crates/storage-cassandra/src/restore_engine.rs (lines 434 to 442 at 95425f5) is one more read of this kind. It reads the restore target's indexes with fetch_indexes_for_table at the driver default. It then writes each restored item's index rows for the indexes that read returns. So an index that the read omits gets no rows for any item of the file.
#527 makes the legacy restore copy (copy_backup_into_target) read the same list with fetch_indexes_for_table_quorum. As this issue says for the other reads, a quorum read meets the catalog rows only once the writes of those rows state a level.
The read. bulk_load reads the target's indexes with fetch_indexes_for_table. That function calls query_rows, which now runs at LOCAL_QUORUM. Before PR#945 it sent no level, so the driver default applied.
The writes. create_table writes the GSI and LSI rows of indexes with Stmt::Write. update_table writes them in a batch built by batch(). Both run at LOCAL_QUORUM, so the quorum read meets them.
For #527, PR#945 removed fetch_indexes_for_table_quorum. fetch_indexes_for_table now does the same job, and the legacy restore copy reads through it.
tests/consistency_policy.rs fails the build if code sets its own level or skips the helpers.
Activity
jcshepherd commentedon Nov 14, 2026
#945 fixes this issue. When #945 merges, this issue can close.
#945 makes every read and write in the Cassandra backend run at
LOCAL_QUORUM, and conditional statements run with Paxos atLOCAL_SERIAL. The level comes from one place,cassandra_util.rs. Theconsistency_policytest fails when a statement does not use it.Each read in this issue now runs at
LOCAL_QUORUM, throughquery_rows:fetch_indexes_for_tabledata/index.rsLOCAL_QUORUMgsi_pendinglast_ready_atreaddata/index.rsLOCAL_QUORUMdelete_indexes_for_tabledata/index.rsLOCAL_QUORUMclear_ttl_entriesdata/ttl.rsLOCAL_QUORUMttl_config_for_table(throughread_ttl_config)metadata_engine.rsLOCAL_QUORUMThe issue also says the catalog writes in
create_table.rsandupdate_table.rsneed a stated level first. #945 sets that level. The plain catalog writes and theindexesbatch run atLOCAL_QUORUM, and thetablesinsert is an LWT atLOCAL_SERIAL. A quorum read now overlaps each quorum write, so each read sees the row.ttl_config_for_tablestill keeps its 5-second cache frommain. #945 does not change that cache. The TTL audit re-registers items that a write misses while the cache is stale.LeeroyHannigan commentedon Nov 14, 2026
bulk_loadin crates/storage-cassandra/src/restore_engine.rs (lines 434 to 442 at 95425f5) is one more read of this kind. It reads the restore target's indexes withfetch_indexes_for_tableat the driver default. It then writes each restored item's index rows for the indexes that read returns. So an index that the read omits gets no rows for any item of the file.#527 makes the legacy restore copy (
copy_backup_into_target) read the same list withfetch_indexes_for_table_quorum. As this issue says for the other reads, a quorum read meets the catalog rows only once the writes of those rows state a level.jcshepherd commentedon Nov 18, 2026
@LeeroyHannigan, PR#945 covers both points in your comment.
The read. bulk_load reads the target's indexes with fetch_indexes_for_table. That function calls query_rows, which now runs at LOCAL_QUORUM. Before PR#945 it sent no level, so the driver default applied.
The writes. create_table writes the GSI and LSI rows of indexes with Stmt::Write. update_table writes them in a batch built by batch(). Both run at LOCAL_QUORUM, so the quorum read meets them.
For #527, PR#945 removed fetch_indexes_for_table_quorum. fetch_indexes_for_table now does the same job, and the legacy restore copy reads through it.
tests/consistency_policy.rs fails the build if code sets its own level or skips the helpers.
jcshepherd commentedon Nov 18, 2026
Closing with #945