{"record":{"id":"8a69efde9a22d6f9","repo":"apache/cassandra","slug":"cannot-drop-keyspace-s-as-it-contains-accord-ta-8a69ef","errorCode":null,"errorMessage":"Cannot drop keyspace '%s' as it contains accord tables. (%s)","messagePattern":"Cannot drop keyspace '(.+?)' as it contains accord tables\\. \\((.+?)\\)","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/schema/DropKeyspaceStatement.java","lineNumber":78,"sourceCode":"        KeyspaceMetadata keyspace = schema.getNullable(keyspaceName);\n        if (keyspace != null)\n        {\n            // check that no accord tables in the keyspace are currently in the process of being dropped\n            List<TableMetadata> pendingDrop = keyspace.tables.stream()\n                                                             .filter(t -> t.params.pendingDrop)\n                                                             .collect(Collectors.toList());\n            if (!pendingDrop.isEmpty())\n                throw ire(\"Cannot drop keyspace '%s' as it contains accord tables which are currently being dropped. \" +\n                          \"Please wait for those operations to complete before dropping the keyspace. (%s)\",\n                          keyspaceName, pendingDrop.stream()\n                                                   .map(Object::toString)\n                                                   .collect(Collectors.joining(\",\")));\n\n            List<TableMetadata> accordTables = keyspace.tables.stream()\n                                               .filter(TableMetadata::requiresAccordSupport)\n                                               .collect(Collectors.toList());\n            if (!accordTables.isEmpty())\n                throw ire(\"Cannot drop keyspace '%s' as it contains accord tables. (%s)\",\n                          keyspaceName, accordTables.stream()\n                                                   .map(Object::toString)\n                                                   .collect(Collectors.joining(\",\")));\n            return schema.without(keyspaceName);\n        }\n\n        if (ifExists)\n            return schema;\n\n        throw ire(\"Keyspace '%s' doesn't exist\", keyspaceName);\n    }\n\n    SchemaChange schemaChangeEvent(KeyspacesDiff diff)\n    {\n        return new SchemaChange(Change.DROPPED, keyspaceName);\n    }\n\n    public void authorize(ClientState client)","sourceCodeStart":60,"sourceCodeEnd":96,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/schema/DropKeyspaceStatement.java#L60-L96","documentation":"DROP KEYSPACE was rejected because the keyspace still contains Accord-enabled (transactional) tables. This build does not allow dropping a keyspace while Accord tables exist; they must be dropped individually first.","triggerScenarios":"DROP KEYSPACE ks where any table in ks returns requiresAccordSupport() == true and none are merely pendingDrop.","commonSituations":"Tearing down a keyspace holding transactional (Accord) tables; cleanup scripts written before Accord support that assume DROP KEYSPACE covers all tables.","solutions":["Drop each Accord table explicitly (DROP TABLE ...), waiting for drops to complete.","Then re-run DROP KEYSPACE.","Relocate Accord tables to a dedicated keyspace so other keyspaces can be dropped freely."],"exampleFix":"// before\nDROP KEYSPACE ks; // contains txn tables\n// after\nDROP TABLE ks.txn_orders;\nDROP KEYSPACE ks;","handlingStrategy":"validation","validationCode":"boolean hasAccord = schema.getKeyspace(ks).tables.stream()\n    .anyMatch(TableMetadata::requiresAccordSupport);\nif (hasAccord) dropAccordTablesFirst(ks);","typeGuard":null,"tryCatchPattern":"catch (InvalidRequestException e) { if (e.getMessage().contains(\"accord tables\")) { /* parse table list from message and drop them first */ } else throw e; }","preventionTips":["Keep Accord tables in a dedicated keyspace","Add Accord-table detection to cleanup scripts","Document that DROP KEYSPACE does not cover Accord tables"],"tags":["cql","schema","accord"],"backgroundTag":"unsupported-operation","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"}