{"record":{"id":"d8ba261ac0aa114d","repo":"apache/cassandra","slug":"warnings-msg-with-loggabletokens-client-warni-d8ba26","errorCode":null,"errorMessage":"<warnings msg> with <loggableTokens> (client warning; msg from WarningsSnapshot warning message)","messagePattern":"<warnings msg> with <loggableTokens> \\(client warning; msg from WarningsSnapshot warning message\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/reads/thresholds/CoordinatorWarnings.java","lineNumber":141,"sourceCode":"    }\n\n    private static void recordAborts(WarningsSnapshot.Warnings counter, String cql, String loggableTokens, TableMetrics.TableMeter metric, ToString toString)\n    {\n        if (!counter.aborts.instances.isEmpty())\n        {\n            String msg = toString.apply(counter.aborts.instances.size(), counter.aborts.maxValue, cql);\n            ClientWarn.instance.warn(msg + \" with \" + loggableTokens);\n            logger.warn(msg);\n            metric.mark();\n        }\n    }\n\n    private static void recordWarnings(WarningsSnapshot.Warnings counter, String cql, String loggableTokens, TableMetrics.TableMeter metric, ToString toString)\n    {\n        if (!counter.warnings.instances.isEmpty())\n        {\n            String msg = toString.apply(counter.warnings.instances.size(), counter.warnings.maxValue, cql);\n            ClientWarn.instance.warn(msg + \" with \" + loggableTokens);\n            logger.warn(msg);\n            metric.mark();\n        }\n    }\n\n    /**\n     * Utility class to create an immutable map which does not fail on mutation but instead ignores it.\n     */\n    private static final class IgnoreMap extends AbstractMap<Object, Object>\n    {\n        private static final IgnoreMap INSTANCE = new IgnoreMap();\n\n        private static <K, V> Map<K, V> get()\n        {\n            return (Map<K, V>) INSTANCE;\n        }\n\n        @Override","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/reads/thresholds/CoordinatorWarnings.java#L123-L159","documentation":"CoordinatorWarnings.recordWarnings() reports accumulated read-threshold WARNINGS from a WarningsSnapshot (e.g. tombstone warnings, large-row/cell warnings during reads). For each warning counter with instances, '<msg> with <loggableTokens>' is sent as a client warning, logged server-side, and the table metric is marked. It indicates a read is expensive but was still served.","triggerScenarios":"A query crossed a read warning threshold (e.g. more tombstones/rows touched than tombstone_warn_threshold, or row-size limits) on replicas; the coordinator aggregates the snapshot and emits the client warning via processWarnings().","commonSituations":"ALLOW FILTERING or broad partition scans touching many tombstones; tables with heavy TTL/delete churn; queries hitting many SSTables.","solutions":["Refine the query to narrow partitions scanned","Run compaction and clean up tombstone buildup","Raise the corresponding warning threshold in cassandra.yaml only if the cost is understood and acceptable","Use the logged message (count, max value, CQL) to find and fix the offending query pattern"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check read scope before executing\nif (!cql.contains(\"WHERE\") || !cql.matches(\".*\\\\s=?\\\\s*<partitionKey>.*\"))\n    logger.warn(\"Broad read may exceed warning thresholds: {}\", cql);","typeGuard":null,"tryCatchPattern":"ResultSet rs = session.execute(cql);\nfor (String w : rs.getExecutionInfo().getWarnings()) {\n    if (w.contains(\"tombstone\") || w.contains(\"warning\"))\n        log.warn(\"Coordinator read warning: {}\", w);\n}","preventionTips":["Design tables to avoid wide scans","Track read-warning metrics per table","Tune warn thresholds deliberately, not to silence"],"tags":["warnings","query","coordinator","tombstones"],"backgroundTag":"value-out-of-range","analyzedSha":"88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1","analyzedAt":"2026-09-10T07:29:22.284Z","contentChangedAt":"2026-09-10T07:29:22.284Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}