{"record":{"id":"a8a51d6b12446bcb","repo":"apache/cassandra","slug":"accord-transactions-are-disabled-on-table-table-i","errorCode":null,"errorMessage":"Accord transactions are disabled on table (table is being dropped); %s statement %s","messagePattern":"Accord transactions are disabled on table \\(table is being dropped\\); (.+?) statement (.+?)","errorType":"validation","errorClass":"InvalidRequestException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java","lineNumber":708,"sourceCode":"    {\n        // false is the default, but still best to be explicit.\n        return false;\n    }\n\n    private static void validate(SelectStatement.RawStatement select)\n    {\n        if (select.parameters.orderings != null && !select.parameters.orderings.isEmpty())\n            throw invalidRequest(NO_ORDER_BY_IN_TXNS_MESSAGE, \"SELECT\", select.source);\n        if (select.parameters.groups != null && !select.parameters.groups.isEmpty())\n            throw invalidRequest(NO_GROUP_BY_IN_TXNS_MESSAGE, \"SELECT\", select.source);\n    }\n\n    private static void validate(SelectStatement prepared)\n    {\n        if (!prepared.table.isAccordEnabled())\n            throw invalidRequest(TRANSACTIONS_DISABLED_ON_TABLE_MESSAGE, \"SELECT\", prepared.source);\n        if (prepared.table.params.pendingDrop)\n            throw invalidRequest(TRANSACTIONS_DISABLED_ON_TABLE_BEING_DROPPED_MESSAGE, \"SELECT\", prepared.source);\n        if (prepared.table.isCounter())\n            throw invalidRequest(NO_COUNTERS_IN_TXNS_MESSAGE, \"SELECT\", prepared.source);\n        if (prepared.hasAggregation())\n            throw invalidRequest(NO_AGGREGATION_IN_TXNS_MESSAGE, \"SELECT\", prepared.source);\n\n        // when \"LIMIT ?\" this check can't be performed, so need to do again once the options are known\n        if (prepared.getRestrictions().keyIsInRelation())\n            checkTrue(prepared.isLimitMarker() || prepared.getLimit(null) == DataLimits.NO_LIMIT, NO_PARTITION_IN_CLAUSE_WITH_LIMIT, \"SELECT\", prepared.source);\n    }\n\n    public static class Parsed extends QualifiedStatement.Composite\n    {\n        private final List<SelectStatement.RawStatement> assignments;\n        private final SelectStatement.RawStatement select;\n        private final List<RowDataReference.Raw> returning;\n        private final List<ModificationStatement.Parsed> updates;\n        private final List<ConditionStatement.Raw> conditions;\n        private final List<RowDataReference.Raw> dataReferences;","sourceCodeStart":690,"sourceCodeEnd":726,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/TransactionStatement.java#L690-L726","documentation":"The table targeted by a transactional SELECT is pending drop, so Accord refuses to run transactions against it. TransactionStatement.validate(SelectStatement) throws when prepared.table.params.pendingDrop is true.","triggerScenarios":"Issuing BEGIN TRANSACTION ... COMMIT containing a SELECT on a table that is being dropped (a DROP TABLE for it is in progress, typically staged via DROP TABLE with a wait or in-flight drop).","commonSituations":"Race between a schema migration dropping a table and application code still issuing transactions on it.","solutions":["Wait for the DROP TABLE to complete, then stop referencing the table","Cancel/avoid dropping the table if transactions are still needed","Remove the pending-drop table from the transaction"],"exampleFix":"// before (drop in flight)\nBEGIN TRANSACTION SELECT ... FROM dying_t; COMMIT;\n// after\n// complete/cancel the drop, then use a live table\nBEGIN TRANSACTION SELECT ... FROM live_t; COMMIT;","handlingStrategy":"retry","validationCode":"// verify the table still exists and is not being dropped\nif (cluster.getMetadata().getKeyspace(ks) == null || cluster.getMetadata().getKeyspace(ks).getTable(table) == null) throw new IllegalStateException(\"table missing/pending drop\");","typeGuard":null,"tryCatchPattern":"try { session.execute(txnCql); } catch (InvalidRequestException e) { if (e.getMessage().contains(\"table is being dropped\")) { /* back off, refresh schema metadata, skip target */ } else throw e; }","preventionTips":["Coordinate schema drops with application deployments","Refresh cluster metadata before issuing transactions after migrations","Use feature flags to stop traffic to tables slated for deletion"],"tags":["cql","accord","schema-drop","validation"],"backgroundTag":"invalid-state-transition","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"}