apache/cassandra · error · IllegalArgumentException
Unsupported snitch
Error message
Unsupported snitch
What it means
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.
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.
Example fix
// before (cassandra.yaml) endpoint_snitch: MyCustomSnitch // after endpoint_snitch: SimpleSnitch
Defensive patterns
Strategy: validation
Validate before calling
// before startup
NodeProximity p = ...;
if (p instanceof DynamicEndpointSnitch) p = ((DynamicEndpointSnitch) p).delegate;
if (!p.supportCompareByEndpoint()) throw new IllegalStateException("Snitch " + p.getClass() + " unsupported for Accord"); Type guard
boolean isAccordCompatibleSnitch(NodeProximity p) { return p.supportCompareByEndpoint(); } Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- accord.cache_size option was set incorrectly to
- accord.journal_directory must be specified
- accord.journal_directory must not be the same as any…
- Cannot change transactional mode to
- Cannot create table . with transactional mode with…
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/9223b6fb74a7b6ef.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/service/accord/api/AccordTopologySorter.java:93
}
}
private final AccordEndpointMapper mapper;
private final Comparator<Endpoint> comparator;
private AccordTopologySorter(AccordEndpointMapper mapper, Comparator<Endpoint> comparator)
{
this.mapper = mapper;
this.comparator = comparator;
}
public static void checkSnitchSupported(NodeProximity proximity)
{
if (!proximity.supportCompareByEndpoint())
{
if (proximity instanceof DynamicEndpointSnitch)
proximity = ((DynamicEndpointSnitch) proximity).delegate;
throw new IllegalArgumentException("Unsupported snitch " + proximity.getClass() + "; supportCompareByEndpoint returned false");
}
}
@Override
public int compare(Node.Id node1, Node.Id node2, ShardSelection shards)
{
InetAddressAndPort ep1 = mapper.mappedEndpointOrNull(node1);
InetAddressAndPort ep2 = mapper.mappedEndpointOrNull(node2);
return compare(comparator, ep1, ep2);
}
@Override
public boolean isFaulty(Node.Id node)
{
return mapper.nodeStatus(node) != HEALTHY;
}
private static class SortableEndpoints extends ArrayList<InetAddressAndPort> implements Sortable<InetAddressAndPort, SortableEndpoints>View on GitHub (pinned to 88fd0f6a0e)