{"record":{"id":"b290c77eb010aee2","repo":"apache/cassandra","slug":"initiator-directory-different-from-our","errorCode":null,"errorMessage":"Initiator directory different from our","messagePattern":"Initiator directory different from our","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tcm/migration/Election.java","lineNumber":237,"sourceCode":"    public class PrepareHandler implements IVerbHandler<CMSInitializationRequest>\n    {\n        @Override\n        public void doVerb(Message<CMSInitializationRequest> message) throws IOException\n        {\n            logger.info(\"Received election initiation message {} from {}\", message.payload, message.from());\n            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","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/migration/Election.java#L219-L255","documentation":"Warning logged by the CMS initialization request handler (Election's InitHandler.doVerb) when the directory contained in the initiator's CMSInitializationRequest does not equal the node's own ClusterMetadata directory. The handler sets match=false and dumps the differences; the resulting CMSInitializationResponse with metadataMatches=false causes the initiator to abort migration. Together with error 3132 this prevents migrating onto nodes with divergent membership state.","triggerScenarios":"A node receives TCM_INIT_MIG_REQ during CMS migration and its local ClusterMetadata.directory differs from the initiatorDirectory payload — typically because membership (join/leave/hbo events) diverged between the two nodes before migration started.","commonSituations":"Nodes saw different sequences of node joins/removals (e.g. one node missed a bootstrap); gossip state out of sync after a node restart; the initiator restarted while a peer was offline so placement/ownership directories drifted.","solutions":["Read the dumpDiff output in this node's log to find which directory entries differ, then reconcile membership (restart gossip, wait for full ring convergence) and retry migration","Ensure all nodes are alive and gossip-consistent before initiating the CMS migration (check `nodetool status` on every node)","If a node's metadata is unrecoverably divergent, restart it so it reloads/repairs cluster metadata, then re-run the migration"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"ClusterMetadata current = ClusterMetadata.current();\nif (!initiatorDirectory.equals(current.directory)) {\n    initiatorDirectory.dumpDiff(current.directory);\n    // do not proceed with migration; resync membership first\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure every node observed all recent joins/leaves before initiating migration","Restart freshly restored nodes so they reload current cluster metadata","Watch logs for 'Initiator directory different' warnings as an early drift signal"],"tags":["cluster-metadata","distributed-consistency","migration","diagnostics"],"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"}