{"record":{"id":"bca89d2ebcf0b8c0","repo":"apache/cassandra","slug":"locations-differ","errorCode":null,"errorMessage":"Locations differ: {} != {}","messagePattern":"Locations differ: (.+?) != (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tcm/membership/Directory.java","lineNumber":912,"sourceCode":"\n    public void dumpDiff(Directory other)\n    {\n        if (nextId != other.nextId)\n        {\n            logger.warn(\"nextId differ: {} != {}\", nextId, other.nextId);\n        }\n        if (!Objects.equals(lastModified, other.lastModified))\n        {\n            logger.warn(\"Last modified differ: {} != {}\", lastModified, other.lastModified);\n        }\n        if (!Objects.equals(peers, other.peers))\n        {\n            logger.warn(\"Peers differ: {} != {}\", peers, other.peers);\n            dumpDiff(logger, peers, other.peers);\n        }\n        if (!Objects.equals(locations, other.locations))\n        {\n            logger.warn(\"Locations differ: {} != {}\", locations, other.locations);\n        }\n        if (!Objects.equals(states, other.states))\n        {\n            logger.warn(\"States differ: {} != {}\", states, other.states);\n            dumpDiff(logger, states, other.states);\n        }\n        if (!Objects.equals(endpointsByDC, other.endpointsByDC))\n        {\n            logger.warn(\"Endpoints by dc differ: {} != {}\", endpointsByDC, other.endpointsByDC);\n            dumpDiff(logger, endpointsByDC.asMap(), other.endpointsByDC.asMap());\n        }\n        if (!Objects.equals(racksByDC, other.racksByDC))\n        {\n            logger.warn(\"Racks by dc differ: {} != {}\", racksByDC, other.racksByDC);\n        }\n        if (!Objects.equals(versions, other.versions))\n        {\n            logger.warn(\"Versions differ: {} != {}\", versions, other.versions);","sourceCodeStart":894,"sourceCodeEnd":930,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/membership/Directory.java#L894-L930","documentation":"WARN log from Directory.dumpDiff(Directory) indicating the locations maps (NodeId to DataCenter/location placement) differ between two Directory snapshots. Placement data divergence means the two cluster views would compute different token ownership and replication placement. Diagnostic only.","triggerScenarios":"dumpDiff(other) called when the locations maps are unequal, typically after a node moved datacenters in one view (e.g. via a Move/Locate transformation) or a node is present in one map but missing in the other.","commonSituations":"Operator corrected a node's dc/rack on one node only; directory snapshots compared across a topology migration; stale node replayed older metadata where placements had not yet been updated.","solutions":["Compare which node IDs have differing locations and re-apply the intended topology change as a committed TCM transformation","Replay the cluster metadata log on the diverging node until locations converge","Ensure snitch-based dc/rack assignments are consistent across the cluster before committing topology changes","If a snapshot is simply stale, re-fetch the current Directory from the CMS before diffing"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Validate intended topology is committed cluster-wide before diffing\nClusterMetadata.sync(nodes, targetEpoch);\nfor (Node node : nodes)\n    if (!node.directory.locations().equals(expectedLocations))\n        System.out.println(node + \" has stale locations\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Commit dc/rack changes as TCM transformations, never as local edits","Keep snitch configuration identical across the cluster","After topology migrations, verify all nodes report the same locations before proceeding","Replay the metadata log on any node that missed a topology transformation"],"tags":["cassandra","tcm","topology","diagnostics"],"backgroundTag":"internal-invariant-violation","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"}