{"record":{"id":"6a8c259ec2e3ef21","repo":"apache/cassandra","slug":"racks-by-dc-differ","errorCode":null,"errorMessage":"Racks by dc differ: {} != {}","messagePattern":"Racks by dc differ: (.+?) != (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tcm/membership/Directory.java","lineNumber":926,"sourceCode":"            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);\n            dumpDiff(logger, versions, other.versions);\n        }\n        if (!Objects.equals(addresses, other.addresses))\n        {\n            logger.warn(\"Addresses differ: {} != {}\", addresses, other.addresses);\n            dumpDiff(logger, addresses, other.addresses);\n        }\n    }\n\n    public static <K, V> void dumpDiff(Logger logger, Map<K, V> l, Map<K, V> r)\n    {\n        for (K k : Sets.intersection(l.keySet(), r.keySet()))\n        {\n            V lv = l.get(k);","sourceCodeStart":908,"sourceCodeEnd":944,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/membership/Directory.java#L908-L944","documentation":"WARN log from Directory.dumpDiff(Directory) indicating the racksByDC mapping (dc to set of racks) differs between two Directory snapshots. Like endpointsByDC this is derived placement state; divergence means the views disagree on which racks exist per datacenter, affecting rack-aware replica placement. Diagnostic output only.","triggerScenarios":"dumpDiff(other) when racksByDC maps are unequal; typically a consequence of a node registering in a new rack/dc in one view but not the other, or a node disappearing from a rack in one view.","commonSituations":"Rack added or removed as part of a topology change seen by only part of the cluster; stale directory snapshot compared against a current one; misconfigured snitch reporting inconsistent rack names across nodes.","solutions":["Resolve the underlying peers/locations divergence; racksByDC is derived and will converge with it","Ensure every node's snitch reports the same dc/rack names for the same endpoints (check cassandra-rackdc.properties)","Replay missed cluster metadata commits on the diverging node","Re-fetch the current Directory from the CMS before re-running the comparison"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Ensure snitch-derived dc/rack names are consistent before comparing\nfor (InetAddressAndPort ep : allEndpoints)\n    assert snitch.getDatacenter(ep).equals(expectedDc(ep))\n        : \"Snitch mismatch for \" + ep;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep cassandra-topology.properties / cassandra-rackdc.properties consistent cluster-wide","Use the same snitch implementation on every node","Commit rack changes via TCM transformations and confirm replication","Diff only synchronized snapshots"],"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"}