apache/cassandra · warning
Read on table has exceeded the size warning threshold of…
Error message
Read on table %s has exceeded the size warning threshold of %,d bytes with ...
What it means
A coordinator read whose result exceeds the coordinator_read_size_warn_threshold_kb limit triggers this client warning (and a server log). The read still succeeds; it only flags that an unbounded partition/restricted query returned more data than expected.
Solutions
- Add a LIMIT clause or narrow the partition key restrictions
- Raise cassandra.coordinator_read_size_warn_threshold_kb if reads are legitimately large
- Paging with driver fetch size to cap per-page memory
- Investigate/fix large partitions with a compaction/data-model review
Example fix
// before SELECT * FROM events WHERE device_id = ?; // partition grew to GBs // after SELECT * FROM events WHERE device_id = ? LIMIT 10000; // plus paging
Defensive patterns
Strategy: validation
Validate before calling
// enforce LIMIT/narrowed WHERE before issuing reads on wide tables
if (!cql.toLowerCase().contains("limit") && !hasPartitionKeyRestriction(cql)) {
throw new IllegalArgumentException("unbounded read on wide table requires LIMIT");
} Prevention
- Always LIMIT unbounded reads
- Enable paging with a bounded fetch size
- Monitor coordinator_read_size metrics and large partitions
When it happens
Trigger: SELECT returning a result larger than cassandra.coordinator_read_size_warn_threshold_kb; raised in SelectStatement's result-processing path when result.shouldWarn(...) is true; threshold value -1 disables it.
Common situations: Large-partition tables read with wide SELECTs; missing LIMIT on queries; thresholds lowered after a memory incident; unbounded IN queries fanning out.
Understand the failure class
Background: payload too large / request exceeds maximum size: why libraries cap bytes and how to fix oversize payloads — this error's family across 50 libraries.
Related errors
- Read on table has exceeded the size failure threshold of…
- Aggregation query used on multiple partition keys (IN…
- Aggregation query used without partition key
- <dynamic warning, no literal in source: built by…
- Guardrail violated
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/66175f2b2ea90696.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/cql3/statements/SelectStatement.java:1139
for (int i = 0; i < components.length; i++)
result[i] = ByteBufferUtil.getArrayUnsafeNullable(components[i]);
return result;
}
return new byte[][]{ ByteBufferUtil.getArrayUnsafeNullable(key) };
}
private void maybeWarn(ResultSetBuilder result, QueryOptions options)
{
if (!options.isReadThresholdsEnabled())
return;
ColumnFamilyStore store = cfs();
if (store != null)
store.metric.coordinatorReadSize.update(result.getSize());
if (result.shouldWarn(options.getCoordinatorReadSizeWarnThresholdBytes()))
{
String msg = String.format("Read on table %s has exceeded the size warning threshold of %,d bytes", table, options.getCoordinatorReadSizeWarnThresholdBytes());
ClientState state = ClientState.forInternalCalls();
ClientWarn.instance.warn(msg + " with " + loggableTokens(options, state));
logger.warn("{} with query {}", msg, asCQL(options, state));
if (store != null)
store.metric.coordinatorReadSizeWarnings.mark();
}
}
private void maybeFail(ResultSetBuilder result, QueryOptions options)
{
if (!options.isReadThresholdsEnabled())
return;
if (result.shouldReject(options.getCoordinatorReadSizeAbortThresholdBytes()))
{
String msg = String.format("Read on table %s has exceeded the size failure threshold of %,d bytes", table, options.getCoordinatorReadSizeAbortThresholdBytes());
ClientState state = ClientState.forInternalCalls();
String clientMsg = msg + " with " + loggableTokens(options, state);
ClientWarn.instance.warn(clientMsg);
logger.warn("{} with query {}", msg, asCQL(options, state));
ColumnFamilyStore store = cfs();View on GitHub (pinned to 88fd0f6a0e)