{"record":{"id":"2f920755a3e2ed46","repo":"apache/cassandra","slug":"value-for-key-is-only-present-in-the-right-set","errorCode":null,"errorMessage":"Value for key {} is only present in the right set: {}","messagePattern":"Value for key (.+?) is only present in the right set: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/tcm/membership/Directory.java","lineNumber":952,"sourceCode":"        {\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);\n            V rv = r.get(k);\n            if (!Objects.equals(lv, rv))\n                logger.warn(\"Values for key {} differ: {} != {}\", k, lv, rv);\n        }\n        for (K k : Sets.difference(l.keySet(), r.keySet()))\n            logger.warn(\"Value for key {} is only present in the left set: {}\", k, l.get(k));\n        for (K k : Sets.difference(r.keySet(), l.keySet()))\n            logger.warn(\"Value for key {} is only present in the right set: {}\", k, r.get(k));\n\n    }\n\n    public static class RemovedNode implements Comparable<RemovedNode>\n    {\n        public final Epoch removedIn;\n        public final NodeId id;\n        public final InetAddressAndPort endpoint;\n\n        public RemovedNode(Epoch removedIn, NodeId id, InetAddressAndPort endpoint)\n        {\n            this.removedIn = removedIn;\n            this.id = id;\n            this.endpoint = endpoint;\n        }\n\n        public boolean equals(Object object)\n        {","sourceCodeStart":934,"sourceCodeEnd":970,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/tcm/membership/Directory.java#L934-L970","documentation":"Companion warning of Directory.dumpDiff: it logs keys that exist only in the right-hand directory, i.e. the compared Directory knows about nodes/mappings that the local directory lacks. Like its left-set sibling it is diagnostic logging emitted when two directories that should match do not, typically during CMS initialization verification.","triggerScenarios":"Directory.dumpDiff(this, other) is called after a failed equals() between two Directory instances and the right directory contains entries absent from the left, e.g. the local node's directory is missing entries the initiator has.","commonSituations":"A joining node has not yet learned about recently added cluster members; the initiator migrated the cluster while this node was down; gossip/TCM replication lag or a partition left the local metadata behind.","solutions":["Verify network connectivity and let the CMS replicate metadata to the lagging node, then retry the operation","Compare the logged entries against nodetool status / cluster membership to find which nodes the local directory is missing","If a node is genuinely gone, complete its decommission so the extra directory entries are removed"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!expectedDirectory.equals(ClusterMetadata.current().directory)) {\n    expectedDirectory.dumpDiff(ClusterMetadata.current().directory);\n    throw new IllegalStateException(\"Local metadata is behind; resync before proceeding\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the CMS has fully replicated to all nodes before comparing directories","Never compare metadata against a node that was offline during recent membership changes","Treat extra directory entries as signs of incomplete decommissions and clean them up"],"tags":["logging","cluster-metadata","diagnostics","distributed-consistency"],"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-14T16:17:12.679Z"}