{"record":{"id":"b89405fa46f27f52","repo":"apache/cassandra","slug":"cannot-enable-accord-on-system-tables-s-s","errorCode":null,"errorMessage":"Cannot enable accord on system tables (%s.%s)","messagePattern":"Cannot enable accord on system tables \\((.+?)\\.(.+?)\\)","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java","lineNumber":642,"sourceCode":"\n        @Override\n        public void validate(ClientState state)\n        {\n            super.validate(state);\n            // If a memtable configuration is specified, validate it against config\n            if (attrs.hasOption(TableParams.Option.MEMTABLE))\n                MemtableParams.get(attrs.getString(TableParams.Option.MEMTABLE.toString()));\n            Guardrails.tableProperties.guard(attrs.updatedProperties(), attrs::removeProperty, state);\n\n            TableParams paramsForValidation = attrs.asNewTableParams(keyspaceName);\n            validateDefaultTimeToLive(paramsForValidation);\n            validateMinimumTrainingFrequencyForDictionaryCompressor(paramsForValidation);\n        }\n\n        private TableParams validateAndUpdateTransactionalMigration(boolean isCounter, TableParams prev, TableParams next)\n        {\n            if (next.transactionalMode.accordIsEnabled && SchemaConstants.isSystemKeyspace(keyspaceName))\n                throw ire(\"Cannot enable accord on system tables (%s.%s)\", keyspaceName, tableName);\n\n            boolean modeChange = prev.transactionalMode != next.transactionalMode;\n            boolean wasMigrating = prev.transactionalMigrationFrom.isMigrating();\n            boolean explicitlySetMigrationFrom = attrs.hasOption(Option.TRANSACTIONAL_MIGRATION_FROM);\n            // set table to migrating\n            TransactionalMigrationFromMode newMigrateFrom = TransactionalMigrationFromMode.fromMode(prev.transactionalMode, next.transactionalMode);\n\n            if (isCounter && (next.transactionalMode != TransactionalMode.off || newMigrateFrom != TransactionalMigrationFromMode.none || next.transactionalMigrationFrom != TransactionalMigrationFromMode.none))\n                throw ire(format(ACCORD_COUNTER_TABLES_UNSUPPORTED, keyspaceName, tableName));\n\n            boolean forceMigrationChange = modeChange && explicitlySetMigrationFrom && next.transactionalMigrationFrom != newMigrateFrom;\n\n            if (modeChange && next.transactionalMode.accordIsEnabled && !DatabaseDescriptor.getAccordTransactionsEnabled())\n                throw ire(format(\"Cannot change transactional mode to %s for %s.%s with accord.enabled set to false\",\n                                 next.transactionalMode, keyspaceName, tableName));\n\n            // user is manually updating migration mode, don't interfere\n            if (forceMigrationChange)","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/AlterTableStatement.java#L624-L660","documentation":"Transactional Mode (Accord) cannot be enabled on tables in the system keyspaces. validateAndUpdateTransactionalMigration (AlterTableStatement.java:642) rejects any altered TableParams whose transactionalMode has Accord enabled when SchemaConstants.isSystemKeyspace(keyspaceName) is true, since internal tables must keep the default transactional behavior.","triggerScenarios":"ALTER TABLE system.some_table WITH transactional_mode = 'accord' (or any Accord-enabled mode), applied via CQL or a programmatic TableParams alteration on a keyspace like system, system_schema, etc.","commonSituations":"Trying to experiment with Accord-based transactions on internal tables; schema generation tools copying table params from an application keyspace onto a system table.","solutions":["Do not enable Accord on system tables; keep transactional_mode = 'off' for them","Apply the transactional_mode change to your application keyspaces' tables only","If a generated script targets system tables, exclude them from the migration"],"exampleFix":"// before\nALTER TABLE system.local WITH transactional_mode = 'accord';\n// after\nALTER TABLE my_app.orders WITH transactional_mode = 'accord';","handlingStrategy":"validation","validationCode":"if (SchemaConstants.isSystemKeyspace(ks) && params.transactionalMode.accordIsEnabled) { /* skip or reject the alteration before sending */ }","typeGuard":null,"tryCatchPattern":"try { session.execute(alterStmt); } catch (InvalidRequestException e) { if (e.getMessage().startsWith(\"Cannot enable accord on system tables\")) { /* exclude system keyspaces from migration */ } else throw e; }","preventionTips":["Filter out system keyspaces in any schema-migration tool","Never copy table params from app tables onto system tables","Keep transactional_mode 'off' for all internal tables"],"tags":["cassandra","accord","transactional-mode","system-keyspace","schema"],"backgroundTag":"invalid-argument-value","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"}