apache/cassandra · error · InvalidRequestException
read_repair must be set to 'NONE' for transiently…
Error message
read_repair must be set to 'NONE' for transiently replicated keyspaces
What it means
Keyspaces with transient replication do not support read repair, so every table in such a keyspace must set read_repair = 'NONE'. AlterTableStatement.apply (line 706) throws this InvalidRequest when keyspace.replicationStrategy.hasTransientReplicas() and the altered params.readRepair is not ReadRepairStrategy.NONE.
Solutions
- Set read_repair = 'NONE' on tables in transiently replicated keyspaces
- Remove transient replicas from the keyspace replication strategy if you need read repair
- Leave read_repair unset (defaults allow the change only if result is NONE) and use repair (nodetool repair) for consistency instead
Example fix
// before ALTER TABLE orders WITH read_repair = 'blocking'; // after (transiently replicated keyspace) ALTER TABLE orders WITH read_repair = 'NONE';
Defensive patterns
Strategy: validation
Validate before calling
boolean transient = Schema.instance.getKeyspaceMetadata(ks).params.replication.hasTransientReplicas(); if (transient && params.readRepair != ReadRepairStrategy.NONE) { /* force read_repair = NONE or drop transient replicas */ } Try / catch
try { session.execute(alterStmt); } catch (InvalidRequestException e) { if (e.getMessage().contains("read_repair must be set to 'NONE'")) { /* set read_repair = NONE for this keyspace */ } else throw e; } Prevention
- Check the keyspace strategy for transient_replicas before setting read_repair
- Template table options per keyspace, not globally
- Rely on nodetool repair instead of read repair for transiently replicated keyspaces
When it happens
Trigger: ALTER TABLE ... WITH read_repair = 'blocking' (or 'sync') on any table in a keyspace created with transient_replicas (e.g. NetworkTopologyStrategy with a transient replica count); also altering into a read_repair strategy other than NONE.
Common situations: Generic tuning scripts setting read_repair across all tables; not realizing the keyspace uses transient replication; trying to re-enable blocking read repair removed in newer Cassandra versions.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- ACCESS TO DATACENTERS operations not supported by…
- Cannot add new field
- Cannot add new field
- Cannot alter gc_grace_seconds of the base table of a…
- Cannot rename column
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/d1eb27fcf485164a.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java:706
TableParams params = attrs.asAlteredTableParams(table.params);
if (table.isCounter() && params.defaultTimeToLive > 0)
throw ire("Cannot set default_time_to_live on a table with counters");
if (!isEmpty(keyspace.views.forTable(table.id)) && params.gcGraceSeconds == 0)
{
throw ire("Cannot alter gc_grace_seconds of the base table of a " +
"materialized view to 0, since this value is used to TTL " +
"undelivered updates. Setting gc_grace_seconds too low might " +
"cause undelivered updates to expire " +
"before being replayed.");
}
if (keyspace.replicationStrategy.hasTransientReplicas()
&& params.readRepair != ReadRepairStrategy.NONE)
{
throw ire("read_repair must be set to 'NONE' for transiently replicated keyspaces");
}
if (!params.compression.isEnabled())
Guardrails.uncompressedTablesEnabled.ensureEnabled(state);
params = validateAndUpdateTransactionalMigration(table.isCounter(), table.params, params);
return keyspace.withSwapped(keyspace.tables.withSwapped(table.withSwapped(params)));
}
}
/**
* {@code ALTER TABLE [IF EXISTS] <table> DROP COMPACT STORAGE}
*/
private static class DropCompactStorage extends AlterTableStatement
{
private static final Logger logger = LoggerFactory.getLogger(AlterTableStatement.class);View on GitHub (pinned to 88fd0f6a0e)