{"record":{"id":"66175f2b2ea90696","repo":"apache/cassandra","slug":"read-on-table-s-has-exceeded-the-size-warning-thr","errorCode":null,"errorMessage":"Read on table %s has exceeded the size warning threshold of %,d bytes with ...","messagePattern":"Read on table (.+?) has exceeded the size warning threshold of %,d bytes with \\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/cql3/statements/SelectStatement.java","lineNumber":1139,"sourceCode":"            for (int i = 0; i < components.length; i++)\n                result[i] = ByteBufferUtil.getArrayUnsafeNullable(components[i]);\n            return result;\n        }\n        return new byte[][]{ ByteBufferUtil.getArrayUnsafeNullable(key) };\n    }\n\n    private void maybeWarn(ResultSetBuilder result, QueryOptions options)\n    {\n        if (!options.isReadThresholdsEnabled())\n            return;\n        ColumnFamilyStore store = cfs();\n        if (store != null)\n            store.metric.coordinatorReadSize.update(result.getSize());\n        if (result.shouldWarn(options.getCoordinatorReadSizeWarnThresholdBytes()))\n        {\n            String msg = String.format(\"Read on table %s has exceeded the size warning threshold of %,d bytes\", table, options.getCoordinatorReadSizeWarnThresholdBytes());\n            ClientState state = ClientState.forInternalCalls();\n            ClientWarn.instance.warn(msg + \" with \" + loggableTokens(options, state));\n            logger.warn(\"{} with query {}\", msg, asCQL(options, state));\n            if (store != null)\n                store.metric.coordinatorReadSizeWarnings.mark();\n        }\n    }\n\n    private void maybeFail(ResultSetBuilder result, QueryOptions options)\n    {\n        if (!options.isReadThresholdsEnabled())\n            return;\n        if (result.shouldReject(options.getCoordinatorReadSizeAbortThresholdBytes()))\n        {\n            String msg = String.format(\"Read on table %s has exceeded the size failure threshold of %,d bytes\", table, options.getCoordinatorReadSizeAbortThresholdBytes());\n            ClientState state = ClientState.forInternalCalls();\n            String clientMsg = msg + \" with \" + loggableTokens(options, state);\n            ClientWarn.instance.warn(clientMsg);\n            logger.warn(\"{} with query {}\", msg, asCQL(options, state));\n            ColumnFamilyStore store = cfs();","sourceCodeStart":1121,"sourceCodeEnd":1157,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/cql3/statements/SelectStatement.java#L1121-L1157","documentation":"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.","triggerScenarios":"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.","commonSituations":"Large-partition tables read with wide SELECTs; missing LIMIT on queries; thresholds lowered after a memory incident; unbounded IN queries fanning out.","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"],"exampleFix":"// before\nSELECT * FROM events WHERE device_id = ?; // partition grew to GBs\n// after\nSELECT * FROM events WHERE device_id = ? LIMIT 10000; // plus paging","handlingStrategy":"validation","validationCode":"// enforce LIMIT/narrowed WHERE before issuing reads on wide tables\nif (!cql.toLowerCase().contains(\"limit\") && !hasPartitionKeyRestriction(cql)) {\n    throw new IllegalArgumentException(\"unbounded read on wide table requires LIMIT\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always LIMIT unbounded reads","Enable paging with a bounded fetch size","Monitor coordinator_read_size metrics and large partitions"],"tags":["cassandra","read-size","guardrail","client-warning"],"backgroundTag":"payload-too-large","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"}