{"record":{"id":"46aaf47e3166ea14","repo":"apache/cassandra","slug":"can-not-commit-transformation-s-s-46aaf4","errorCode":null,"errorMessage":"Can not commit transformation: \"%s\"(%s).","messagePattern":"Can not commit transformation: \"(.+?)\"\\((.+?)\\)\\.","errorType":"exception","errorClass":"java.lang.IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tcm/sequences/SingleNodeSequences.java","lineNumber":207,"sourceCode":"\n        ClusterMetadataService.instance().commit(new PrepareMove(self,\n                                                                 Collections.singleton(newToken),\n                                                                 ClusterMetadataService.instance().placementProvider(),\n                                                                 true),\n                                                 m -> m,\n                                                 failureHandler(\"PrepareMove\", StorageService.instance::markMoveFailed));\n        InProgressSequences.finishInProgressSequences(self);\n\n        if (logger.isDebugEnabled())\n            logger.debug(\"Successfully moved to new token {}\", StorageService.instance.getLocalTokens().iterator().next());\n    }\n\n    private static ClusterMetadataService.CommitFailureHandler<ClusterMetadata> failureHandler(String type, Runnable markFailed)\n    {\n        return (code, msg) -> {\n            logger.warn(\"Got failure committing {} transformation: {} {}\", type, code, msg);\n            markFailed.run();\n            throw new IllegalStateException(String.format(\"Can not commit transformation: \\\"%s\\\"(%s).\", code, msg));\n        };\n    }\n\n    static void resumeMove()\n    {\n        if (ClusterMetadataService.instance().isMigrating() || ClusterMetadataService.state() == ClusterMetadataService.State.GOSSIP)\n            throw new IllegalStateException(\"This cluster is migrating to cluster metadata, can't move until that is done.\");\n\n        ClusterMetadata metadata = ClusterMetadata.current();\n        NodeId self = metadata.myNodeId();\n        MultiStepOperation<?> sequence = metadata.inProgressSequences.get(self);\n        if (sequence == null || sequence.kind() != MultiStepOperation.Kind.MOVE)\n        {\n            String msg = \"No move operation in progress, can't resume\";\n            logger.info(msg);\n            if (StorageService.instance.operationMode() == MOVE_FAILED)\n            {\n                // there is no ongoing move to resume, but operation mode thinks there is","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/sequences/SingleNodeSequences.java#L189-L225","documentation":"failureHandler builds the CommitFailureHandler used by decommission and move. When committing a topology transformation (e.g. PrepareMove or the decommission prepare) fails, it marks the operation failed (e.g. StorageService.markMoveFailed), logs, and throws IllegalStateException carrying the commit result code and message.","triggerScenarios":"ClusterMetadataService.commit() invoking the failure handler for a PrepareMove/PrepareLeave transformation - typically because the CMS rejected or could not replicate the transformation (quorum loss, rejected epoch, precondition failure).","commonSituations":"CMS majority unavailable during a move/decommission; transformation rejected due to concurrent topology change; network partition between the node and CMS members.","solutions":["Check the logged code+message ('Got failure committing ... transformation') for the root cause and fix it (restore CMS quorum, resolve concurrent operation).","Verify CMS availability and connectivity, then resume the operation: `nodetool resumemove` / finish the decommission.","If the operation cannot proceed, abort it (`nodetool abortmove` / `abortdecommission`) and retry later.","Ensure no other topology operation is in flight that conflicts with this one."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!ClusterMetadataService.instance().isCurrent(CMSId)) return; // ensure CMS reachable before committing topology ops","typeGuard":null,"tryCatchPattern":"try { move(token); }\ncatch (IllegalStateException e) { if (e.getMessage().startsWith(\"Can not commit transformation\")) { resumeOrAbort(); } else throw e; }","preventionTips":["Ensure CMS quorum is healthy before topology operations","Avoid overlapping topology transformations","Retry with resume/abort after fixing the commit failure cause"],"tags":["cassandra","commit-failure","cluster-metadata","topology"],"backgroundTag":"database-write-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}