{"record":{"id":"d1eb27fcf485164a","repo":"apache/cassandra","slug":"read-repair-must-be-set-to-none-for-transiently","errorCode":null,"errorMessage":"read_repair must be set to 'NONE' for transiently replicated keyspaces","messagePattern":"read_repair must be set to 'NONE' for transiently replicated keyspaces","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java","lineNumber":706,"sourceCode":"\n            TableParams params = attrs.asAlteredTableParams(table.params);\n\n            if (table.isCounter() && params.defaultTimeToLive > 0)\n                throw ire(\"Cannot set default_time_to_live on a table with counters\");\n\n            if (!isEmpty(keyspace.views.forTable(table.id)) && params.gcGraceSeconds == 0)\n            {\n                throw ire(\"Cannot alter gc_grace_seconds of the base table of a \" +\n                          \"materialized view to 0, since this value is used to TTL \" +\n                          \"undelivered updates. Setting gc_grace_seconds too low might \" +\n                          \"cause undelivered updates to expire \" +\n                          \"before being replayed.\");\n            }\n\n            if (keyspace.replicationStrategy.hasTransientReplicas()\n                && params.readRepair != ReadRepairStrategy.NONE)\n            {\n                throw ire(\"read_repair must be set to 'NONE' for transiently replicated keyspaces\");\n            }\n\n            if (!params.compression.isEnabled())\n                Guardrails.uncompressedTablesEnabled.ensureEnabled(state);\n\n            params = validateAndUpdateTransactionalMigration(table.isCounter(), table.params, params);\n\n            return keyspace.withSwapped(keyspace.tables.withSwapped(table.withSwapped(params)));\n        }\n    }\n\n\n    /**\n     * {@code ALTER TABLE [IF EXISTS] <table> DROP COMPACT STORAGE}\n     */\n    private static class DropCompactStorage extends AlterTableStatement\n    {\n        private static final Logger logger = LoggerFactory.getLogger(AlterTableStatement.class);","sourceCodeStart":688,"sourceCodeEnd":724,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java#L688-L724","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"// before\nALTER TABLE orders WITH read_repair = 'blocking';\n// after (transiently replicated keyspace)\nALTER TABLE orders WITH read_repair = 'NONE';","handlingStrategy":"validation","validationCode":"boolean transient = Schema.instance.getKeyspaceMetadata(ks).params.replication.hasTransientReplicas(); if (transient && params.readRepair != ReadRepairStrategy.NONE) { /* force read_repair = NONE or drop transient replicas */ }","typeGuard":null,"tryCatchPattern":"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; }","preventionTips":["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"],"tags":["cassandra","cql","read-repair","transient-replication","schema"],"backgroundTag":"conflicting-config-options","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}