apache/cassandra · critical · IllegalStateException
Unable to find sufficient sources for streaming range " + ra
Error message
Unable to find sufficient sources for streaming range " + range + " in keyspace " + keyspace
What it means
RangeFetchMapCalculator.getGraph() constructs a flow/capacity graph for non-trivial (pending) range movements and solves for fetch mappings. If, for a given range, addEndpoints() cannot find any live, filter-passing source endpoint even after allowing other-DC endpoints, it throws IllegalStateException — the streaming plan is infeasible.
Source
Thrown at src/java/org/apache/cassandra/dht/RangeFetchMapCalculator.java:342
if (trivialRanges.contains(range))
{
logger.debug("Not optimising trivial range {} for keyspace {}", range, keyspace);
continue;
}
final RangeVertex rangeVertex = new RangeVertex(range);
//Try to only add source endpoints from same DC
boolean sourceFound = addEndpoints(capacityGraph, rangeVertex, true);
if (!sourceFound)
{
logger.info("Using other DC endpoints for streaming for range: {} and keyspace {}", range, keyspace);
sourceFound = addEndpoints(capacityGraph, rangeVertex, false);
}
if (!sourceFound)
throw new IllegalStateException("Unable to find sufficient sources for streaming range " + range + " in keyspace " + keyspace);
}
return capacityGraph;
}
/**
* Create edges with infinite capacity b/w range vertex and all its source endpoints which clear the filters
* @param capacityGraph The Capacity graph on which changes are made
* @param rangeVertex The range for which we need to add all its source endpoints
* @param localDCCheck Should add source endpoints from local DC only
* @return If we were able to add atleast one source for this range after applying filters to endpoints
*/
private boolean addEndpoints(MutableCapacityGraph<Vertex, Integer> capacityGraph, RangeVertex rangeVertex, boolean localDCCheck)
{
boolean sourceFound = false;
Replicas.temporaryAssertFull(rangesWithSources.get(rangeVertex.getRange()));
for (Replica replica : rangesWithSources.get(rangeVertex.getRange()))View on GitHub (pinned to 88fd0f6a0e)
Solutions
- Ensure all replicas owning the pending ranges are alive (nodetool status) before resuming the operation
- Retry the operation after the failed node recovers, or force a rebuild from a healthy source DC (nodetool rebuild -- <dc>)
- Review sourceFilters (RangeStreamer source filter configuration) and relax them so at least one replica qualifies
- Re-run repair to converge data if the operation failed mid-move, then retry
Defensive patterns
Strategy: validation
Validate before calling
for (Range<Token> pending : pendingRanges)
if (tokenMetadata.getReplicasForReading(pending).stream().noneMatch(r -> failureDetector.isAlive(r.endpoint())))
throw new IllegalStateException("No live source for pending range " + pending); Try / catch
try { streamer.fetch(); } catch (IllegalStateException e) { if (e.getMessage().contains("Unable to find sufficient sources for streaming range")) { waitForReplicasUp(); retryFetch(); } else throw e; } Prevention
- Avoid overlapping move/decommission/bootstrap operations
- Keep FailureDetector healthy (gossip) so live replicas are recognized
- Relax same-DC-only streaming filters when cross-DC fallback is desired
When it happens
Trigger: Calling getRangeFetchMapForNonTrivialRanges via getRangeFetchMap during bootstrap/replace/move where a pending range has no available live replica sources after source filters and DC-preference are applied.
Common situations: Range movements (nodetool move/decommission mid-flight) where the previous owner is down; strict endpoint-snitch configs where all replicas for a pending range sit in unavailable hosts; source filters (e.g. only-stream-from-same-DC) excluding everything.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Unable to find sufficient sources for streaming range " + tr
- Keyspace is already added to fetch map
- Unable to find sufficient sources for streaming range in ke
- Unable to find sufficient sources for streaming range in ke
- Discovered existing bootstrap data and %s is not configured;
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/e4e4702d8d18aa1a.
Report an issue: GitHub.