{"record":{"id":"9223b6fb74a7b6ef","repo":"apache/cassandra","slug":"unsupported-snitch","errorCode":null,"errorMessage":"Unsupported snitch ","messagePattern":"Unsupported snitch ","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"src/java/org/apache/cassandra/service/accord/api/AccordTopologySorter.java","lineNumber":93,"sourceCode":"        }\n    }\n\n    private final AccordEndpointMapper mapper;\n    private final Comparator<Endpoint> comparator;\n\n    private AccordTopologySorter(AccordEndpointMapper mapper, Comparator<Endpoint> comparator)\n    {\n        this.mapper = mapper;\n        this.comparator = comparator;\n    }\n\n    public static void checkSnitchSupported(NodeProximity proximity)\n    {\n        if (!proximity.supportCompareByEndpoint())\n        {\n            if (proximity instanceof DynamicEndpointSnitch)\n                proximity = ((DynamicEndpointSnitch) proximity).delegate;\n            throw new IllegalArgumentException(\"Unsupported snitch \" + proximity.getClass() + \"; supportCompareByEndpoint returned false\");\n        }\n    }\n\n    @Override\n    public int compare(Node.Id node1, Node.Id node2, ShardSelection shards)\n    {\n        InetAddressAndPort ep1 = mapper.mappedEndpointOrNull(node1);\n        InetAddressAndPort ep2 = mapper.mappedEndpointOrNull(node2);\n        return compare(comparator, ep1, ep2);\n    }\n\n    @Override\n    public boolean isFaulty(Node.Id node)\n    {\n        return mapper.nodeStatus(node) != HEALTHY;\n    }\n\n    private static class SortableEndpoints extends ArrayList<InetAddressAndPort> implements Sortable<InetAddressAndPort, SortableEndpoints>","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/accord/api/AccordTopologySorter.java#L75-L111","documentation":"Accord's topology code requires the configured snitch's NodeProximity to support comparing nodes by endpoint (supportCompareByEndpoint()). If it does not, AccordTopologySorter.checkSnitchSupported throws IllegalArgumentException; a DynamicEndpointSnitch is unwrapped to its delegate first, so the offending snitch class is reported. This guards against snitches that cannot provide the ordering Accord relies on.","triggerScenarios":"Setting a snitch (e.g. via endpoint_snitch in cassandra.yaml or SNITCH env) whose NodeProximity implementation returns false from supportCompareByEndpoint() and then starting Accord/AccordService, which calls checkSnitchSupported during topology construction.","commonSituations":"Operators switch to a custom or cloud snitch that lacks compare-by-endpoint support; upgrading Cassandra with Accord enabled while keeping an unsupported snitch; wrapping snitches (like DynamicEndpointSnitch) around a delegate that itself is unsupported.","solutions":["Switch endpoint_snitch to a supported snitch whose NodeProximity.supportCompareByEndpoint() returns true (e.g. SimpleSnitch, NetworkTopologyStrategy-based default snitches).","If using a custom snitch, implement supportCompareByEndpoint()/compare-by-endpoint in its NodeProximity implementation.","If using DynamicEndpointSnitch, verify its delegate snitch is supported, since the delegate is the one checked/reported."],"exampleFix":"// before (cassandra.yaml)\nendpoint_snitch: MyCustomSnitch\n// after\nendpoint_snitch: SimpleSnitch","handlingStrategy":"validation","validationCode":"// before startup\nNodeProximity p = ...;\nif (p instanceof DynamicEndpointSnitch) p = ((DynamicEndpointSnitch) p).delegate;\nif (!p.supportCompareByEndpoint()) throw new IllegalStateException(\"Snitch \" + p.getClass() + \" unsupported for Accord\");","typeGuard":"boolean isAccordCompatibleSnitch(NodeProximity p) { return p.supportCompareByEndpoint(); }","tryCatchPattern":null,"preventionTips":["Pin endpoint_snitch to a known-supported snitch in cassandra.yaml for Accord-enabled clusters.","Test custom snitches against supportCompareByEndpoint() before rollout.","Remember DynamicEndpointSnitch is unwrapped — validate its delegate too."],"tags":["accord","snitch","configuration","illegal-argument"],"backgroundTag":"unsupported-config-value","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}