{"record":{"id":"832b3591dfbe3e66","repo":"apache/cassandra","slug":"can-t-commit-transformations-when-running-in-gossi","errorCode":null,"errorMessage":"Can't commit transformations when running in gossip mode. Enable the ClusterMetadataService with `nodetool cms initialize`.","messagePattern":"Can't commit transformations when running in gossip mode\\. Enable the ClusterMetadataService with `nodetool cms initialize`\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/tcm/migration/GossipProcessor.java","lineNumber":34,"sourceCode":" * limitations under the License.\n */\n\npackage org.apache.cassandra.tcm.migration;\n\nimport org.apache.cassandra.tcm.ClusterMetadata;\nimport org.apache.cassandra.tcm.Commit;\nimport org.apache.cassandra.tcm.Epoch;\nimport org.apache.cassandra.tcm.Processor;\nimport org.apache.cassandra.tcm.Retry;\nimport org.apache.cassandra.tcm.Transformation;\nimport org.apache.cassandra.tcm.log.Entry;\n\npublic class GossipProcessor implements Processor\n{\n    @Override\n    public Commit.Result commit(Entry.Id entryId, Transformation transform, Epoch lastKnown, Retry retryPolicy)\n    {\n        throw new IllegalStateException(\"Can't commit transformations when running in gossip mode. Enable the ClusterMetadataService with `nodetool cms initialize`.\");\n    }\n\n    @Override\n    public ClusterMetadata fetchLogAndWait(Epoch waitFor, Retry retryPolicy)\n    {\n        return ClusterMetadata.current();\n    }\n}\n","sourceCodeStart":16,"sourceCodeEnd":43,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/migration/GossipProcessor.java#L16-L43","documentation":"GossipProcessor is the Processor used while the cluster still runs in gossip mode. TCM transformations (metadata commits) can only be applied through the CMS-backed processor, so commit() unconditionally throws IllegalStateException directing the operator to initialize the CMS with `nodetool cms initialize`.","triggerScenarios":"Any code path committing a Transformation (e.g. cluster metadata changes, node join/leave operations) while ClusterMetadataService is still in gossip (pre-migration) mode, so the active processor is GossipProcessor.","commonSituations":"Attempting TCM-only operations on a cluster not yet migrated to TCM; tools/tests that assume CMS mode on a legacy gossip cluster; a node that started with gossip configuration in an otherwise TCM cluster (config mismatch).","solutions":["Run `nodetool cms initialize` on one node to elect a CMS and switch out of gossip mode","After initialization completes, retry the failed transformation/operation","Verify cassandra.yaml/mode configuration so the node uses the same metadata mode as the rest of the cluster","If migration is intended but stuck, fix the underlying migration errors (down peers, metadata mismatch) first"],"exampleFix":"// before\n// gossip-mode cluster:\nClusterMetadataService.instance().getProcessor().commit(...); // throws\n// after\n// $ nodetool cms initialize\nClusterMetadataService.instance().getProcessor().commit(...);","handlingStrategy":"try-catch","validationCode":"if (!ClusterMetadataService.instance().isInitialized()) throw new IllegalStateException(\"CMS not initialized; run nodetool cms initialize first\");","typeGuard":"boolean cmsEnabled() { return !(ClusterMetadataService.instance().getProcessor() instanceof GossipProcessor); }","tryCatchPattern":"try { processor.commit(entryId, transform, lastKnown, retry); } catch (IllegalStateException e) { // prompt operator to run `nodetool cms initialize`, then retry }","preventionTips":["Migrate the cluster to CMS before issuing TCM transformations","Keep metadata-mode configuration consistent across all nodes","Check CMS status (nodetool cms describe) before metadata-mutating operations"],"tags":["cassandra","tcm","gossip"],"backgroundTag":"feature-not-enabled","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"}