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: use one consistency policy (LOCAL_QUORUM / LOCAL_SERIAL) for every statement #770
The Cassandra backend has no consistency policy. Statements default to the
driver's ONE, and individual call sites have been upgraded to LOCAL_QUORUM one at a time, as bugs turned up. With RF 3, a ONE read can
miss an acknowledged write, and the code often acts on "not found" as a fact
(see the comments at cassandra_util.rs:116, put_get_item.rs:606, data/index.rs:50, and PR #508). Upgrading reads alone does not help: a
quorum read overlaps only writes that were also made at quorum. A single
rule — LOCAL_QUORUM for every statement, LOCAL_SERIAL for every
conditional one — is correct for DynamoDB's strong reads, conditional writes
and transactions. It costs nothing on single-node (RF 1) deployments and
removes the per-call-site decision that keeps going wrong. Separately, init creates every keyspace, including the catalog, with RF 1, so a
multi-node cluster set up by the docs keeps all control-plane state on one
node.
Changes
In crates/storage-cassandra/src/cassandra_util.rs, make every helper set
its level explicitly:
query_rows, query_optional, execute: LOCAL_QUORUM
(query_rows_quorum / execute_quorum become redundant);
query_lwt: unchanged (LOCAL_SERIAL, commit at LOCAL_QUORUM);
add a helper that returns a BatchQueryBuilder at LOCAL_QUORUM.
Move every direct session.query_with_values, query_with_params, .query( and BatchQueryBuilder::new() call in non-test source onto
those helpers. Every IF ... statement goes through query_lwt.
Add a test that fails if non-test source in the crate makes those calls
outside cassandra_util.rs.
Do not add a consistency setting. Serve ConsistentRead=false at LOCAL_QUORUM too; a strong read is a valid eventually-consistent read.
init: create keyspaces with the configured replication_factor and datacenter, not 1. serve: log a warning when a keyspace's RF differs
from the config. Docs: raising RF needs nodetool repair before serving.
CI: add one job that runs the Cassandra integration tests on a 3-node,
RF 3 cluster. On RF 1, every consistency level behaves the same, so
today's CI cannot catch these bugs.
Items 1-3 are one PR. Items 5 and 6 can be separate.
docs/rfcs/README.md asks for an RFC for a change to "Public CLI flags or the configuration file format". #909 adds two init flags. Under the README's "If you are unsure" paragraph ("A maintainer will tell you whether an RFC, an ADR, or neither is needed"), I decide, as a maintainer, that #909 needs neither:
--replication-factor N and --datacenter NAME set replication_factor and datacenter in [storage.cassandra]. Both keys exist on main. The configuration file format does not change.
Without the flags and with no config file, init behaves as on main. With init --overwrite, init now uses the file's datacenter for CREATE KEYSPACE, and writes the file's replication_factor and datacenter instead of 1 and datacenter1. init --overwrite now returns an error for replication_factor = 0 and for a datacenter name outside [A-Za-z0-9_.-].
init refuses a keyspace at another replication. serve logs a warning at start-up for each keyspace whose replication differs from the config.
The decisions that an ADR would record:
A section with no replication_factor line means RF=3 as on main today. extenddb init with no --replication-factor flag defaults the RF to 1. Changing the serde default from 3 to 1 (for consistency with extenddb init) would silently give new account keyspaces just one replica on a deployment that relied on 3.
ExtendDB uses one datacenter per deployment.
serve warns of a keyspace at another replication factor but does not refuse to start.
A second maintainer can object here. Without an objection, #909 links this comment in its checklist.
Activity
jcshepherd commentedon Nov 6, 2026
WIP
test(storage-cassandra): test GSI propagation timing and the delay po…
jcshepherd commentedon Nov 13, 2026
RFC and ADR decision for #909 (#770 item 5)
docs/rfcs/README.mdasks for an RFC for a change to "Public CLI flags or the configuration file format". #909 adds twoinitflags. Under the README's "If you are unsure" paragraph ("A maintainer will tell you whether an RFC, an ADR, or neither is needed"), I decide, as a maintainer, that #909 needs neither:--replication-factor Nand--datacenter NAMEsetreplication_factoranddatacenterin[storage.cassandra]. Both keys exist on main. The configuration file format does not change.initbehaves as on main. Withinit --overwrite,initnow uses the file's datacenter forCREATE KEYSPACE, and writes the file'sreplication_factoranddatacenterinstead of 1 anddatacenter1.init --overwritenow returns an error forreplication_factor = 0and for a datacenter name outside[A-Za-z0-9_.-].initrefuses a keyspace at another replication.servelogs a warning at start-up for each keyspace whose replication differs from the config.The decisions that an ADR would record:
replication_factorline means RF=3 as on main today.extenddb initwith no --replication-factor flag defaults the RF to 1. Changing the serde default from 3 to 1 (for consistency withextenddb init) would silently give new account keyspaces just one replica on a deployment that relied on 3.servewarns of a keyspace at another replication factor but does not refuse to start.A second maintainer can object here. Without an objection, #909 links this comment in its checklist.
jcshepherd commentedon Nov 18, 2026
Closing this one. Items 1 to 5 are done. Item 6 moves to #1152.
ConsistentRead=falsereads atLOCAL_QUORUMinitcreates keyspaces with the configured replication factor and datacenter;servewarns when a keyspace differsfeat(storage-cassandra): init sets replication factor and datacenter (E…
feat(storage-cassandra): run reads and writes at LOCAL_QUORUM (Extend…