{"record":{"id":"c05ff2bcef06539d","repo":"apache/cassandra","slug":"peers-differ","errorCode":null,"errorMessage":"Peers differ: {} != {}","messagePattern":"Peers differ: (.+?) != (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tcm/membership/Directory.java","lineNumber":907,"sourceCode":"               Objects.equals(addresses, directory.addresses) &&\n               Objects.equals(removedNodes, directory.removedNodes);\n    }\n    \n    private static final Logger logger = LoggerFactory.getLogger(Directory.class);\n\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        {","sourceCodeStart":889,"sourceCodeEnd":925,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/membership/Directory.java#L889-L925","documentation":"WARN log from Directory.dumpDiff(Directory) reporting the peers maps of two Directory snapshots differ. The peers map maps NodeId to Node objects, so divergence means one snapshot knows about nodes the other does not, or node descriptors differ. The static dumpDiff(logger, peers, other.peers) then logs per-key differences. This is a diagnostic aid, not a thrown error.","triggerScenarios":"dumpDiff(other) called when Objects.equals(peers, other.peers) is false; happens after a bootstrap, decommission, or replacement applied on one member but not yet visible to the other.","commonSituations":"A node joining the cluster while another node's directory is stale; comparison of directory snapshots taken before and after a topology change; split-brain where one side processed a membership change the other rejected.","solutions":["Check which node IDs appear only on one side and determine whether the corresponding transformation (join/leave) was fully committed through the CMS","Replay missed cluster metadata log entries on the stale node until peers converge","If a node is stuck with stale membership, restart it to re-seed cluster metadata from the CMS","Verify there is no split-brain: confirm only one active CMS and a single metadata quorum"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Check membership equivalence and let per-key diff pinpoint the nodes\nif (!java.util.Objects.equals(dirA.peers(), dirB.peers())) {\n    dirA.peers().keySet().forEach(id -> {\n        if (!dirB.peers().containsKey(id))\n            System.out.println(\"Node \" + id + \" missing in right snapshot\");\n    });\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run all topology changes (bootstrap/decommission/replace) through committed TCM transformations","Verify single-CMS operation to avoid split-brain membership views","Compare snapshots at the same epoch only","After membership operations, wait for metadata convergence before asserting equality"],"tags":["cassandra","tcm","membership","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"}