{"record":{"id":"3ea7c171d01c862e","repo":"apache/cassandra","slug":"initiator-tokenmap-different-from-ours","errorCode":null,"errorMessage":"Initiator tokenmap different from ours","messagePattern":"Initiator tokenmap different from ours","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tcm/migration/Election.java","lineNumber":243,"sourceCode":"            if (!updateInitiator(null, message.payload.initiator))\n                throw new IllegalStateException(String.format(\"Got duplicate initiate migration message from %s, migration is already started by %s\", message.from(), initiator()));\n\n            logger.info(\"Sending initiation response\");\n            Directory initiatorDirectory = message.payload.directory;\n            TokenMap initiatorTokenMap = message.payload.tokenMap;\n            UUID initiatorSchemaVersion = message.payload.schemaVersion;\n            ClusterMetadata metadata = ClusterMetadata.current();\n            boolean match = true;\n            if (!initiatorDirectory.equals(metadata.directory))\n            {\n                match = false;\n                logger.warn(\"Initiator directory different from our\");\n                initiatorDirectory.dumpDiff(metadata.directory);\n            }\n            if (!initiatorTokenMap.equals(metadata.tokenMap))\n            {\n                match = false;\n                logger.warn(\"Initiator tokenmap different from ours\");\n                initiatorTokenMap.dumpDiff(metadata.tokenMap);\n            }\n            UUID schemaDigest = SchemaKeyspace.calculateSchemaDigest();\n            if (!initiatorSchemaVersion.equals(schemaDigest))\n            {\n                match = false;\n                logger.warn(\"Initiator schema different from our: {} != {}\", initiatorSchemaVersion, schemaDigest);\n            }\n            messaging.send(message.responseWith(new CMSInitializationResponse(message.payload.initiator, match)), message.from());\n        }\n    }\n\n    public class AbortHandler implements IVerbHandler<CMSInitializationRequest.Initiator>\n    {\n        @Override\n        public void doVerb(Message<CMSInitializationRequest.Initiator> message) throws IOException\n        {\n            logger.info(\"Received election abort message {} from {}\", message.payload, message.from());","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/migration/Election.java#L225-L261","documentation":"Warning logged by the CMS initialization handler when the initiator's token map (ring/token assignment) differs from the local node's ClusterMetadata.tokenMap. As with the directory mismatch, the handler marks the verification as failed and returns metadataMatches=false, so the initiator will not proceed with migration until tokens agree.","triggerScenarios":"During TCM_INIT_MIG_REQ handling, initiatorTokenMap.equals(metadata.tokenMap) is false — e.g. a node still has pre-migration token assignments, missed a token movement, or has stale bootstrap/decommission token data.","commonSituations":"A node was down while another node bootstrapped or decommissioned (token ranges moved); mixing gossip-era token info with TCM metadata; a partially completed bootstrap left token maps inconsistent across nodes.","solutions":["Let the lagging node sync cluster metadata (stay joined to the cluster, verify gossip, restart if needed) until token maps converge, then retry migration","Inspect the dumpDiff output to identify which tokens/ranges differ and whether a bootstrap/decommission was interrupted","Confirm all nodes run a compatible Cassandra version with TCM enabled so token map state is represented consistently"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!initiatorTokenMap.equals(ClusterMetadata.current().tokenMap)) {\n    initiatorTokenMap.dumpDiff(ClusterMetadata.current().tokenMap);\n    // abort migration until token maps converge\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never run CMS migration while a bootstrap or decommission is in progress","Verify token assignments agree cluster-wide (nodetool status / ring) before migration","Keep all nodes on TCM-enabled versions so token map state is uniform"],"tags":["cluster-metadata","tokens","distributed-consistency","migration"],"backgroundTag":"schema-validation-failed","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}