{"record":{"id":"80ce4aa48ab81fd2","repo":"apache/cassandra","slug":"write-to-s-s-partition-s-s-writewarningssnap","errorCode":null,"errorMessage":"Write to %s.%s partition %s: %s (WriteWarningsSnapshot.writeSizeWarnMessage(value))","messagePattern":"Write to (.+?)\\.(.+?) partition (.+?): (.+?) \\(WriteWarningsSnapshot\\.writeSizeWarnMessage\\(value\\)\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/service/writes/thresholds/CoordinatorWriteWarnings.java","lineNumber":139,"sourceCode":"\n        for (Map.Entry<TableId, Long> entry : snapshot.writeSize.tableValues.entrySet())\n        {\n            TableId tableId = entry.getKey();\n            ColumnFamilyStore cfs = Schema.instance.getColumnFamilyStoreInstance(tableId);\n            if (cfs == null)\n            {\n                logger.warn(\"ColumnFamilyStore is null for table {}, skipping\", tableId);\n                continue;\n            }\n\n            TableMetadata metadata = cfs.metadata();\n            String partitionKey = metadata.partitionKeyType.toCQLString(warnings.partitionKey.getKey());\n            String msg = String.format(\"Write to %s.%s partition %s: %s\",\n                                       metadata.keyspace,\n                                       metadata.name,\n                                       partitionKey,\n                                       WriteWarningsSnapshot.writeSizeWarnMessage(entry.getValue()));\n            ClientWarn.instance.warn(msg);\n            logger.warn(msg);\n            cfs.metric.writeSizeWarnings.mark();\n        }\n\n        for (Map.Entry<TableId, Long> entry : snapshot.writeTombstone.tableValues.entrySet())\n        {\n            TableId tableId = entry.getKey();\n            ColumnFamilyStore cfs = Schema.instance.getColumnFamilyStoreInstance(tableId);\n            if (cfs == null)\n            {\n                logger.warn(\"ColumnFamilyStore is null for table {}, skipping\", tableId);\n                continue;\n            }\n\n            TableMetadata metadata = cfs.metadata();\n            String partitionKey = metadata.partitionKeyType.toCQLString(warnings.partitionKey.getKey());\n            String msg = String.format(\"Write to %s.%s partition %s: %s\",\n                                       metadata.keyspace,","sourceCodeStart":121,"sourceCodeEnd":157,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/service/writes/thresholds/CoordinatorWriteWarnings.java#L121-L157","documentation":"CoordinatorWriteWarnings.processWarnings() reports per-table write-size warnings aggregated from replicas. When a written partition value exceeded the write-size warning threshold, a message 'Write to <ks>.<table> partition <key>: <detail>' is sent as a client warning, logged, and writeSizeWarnings metric is incremented. The write succeeded but was unusually large.","triggerScenarios":"Mutations whose partition value (data written to a single partition key) exceeded the write_size warning threshold; the coordinator's next processWarnings call formats the message and warns the client.","commonSituations":"Unbounded partition growth (e.g. time-series rows never partitioned); very large blobs/collections in one partition; batch writes inflating partition size.","solutions":["Redesign the schema to split large partitions (bucketing keys, time buckets)","Cap row/collection sizes at the application layer before writing","Raise the write-size warning threshold in cassandra.yaml only deliberately","Inspect the warning's partition key to find and fix the offending writer"],"exampleFix":"// before: one partition per user grows forever\nINSERT INTO events (user_id, ts, payload) VALUES (?, ?, ?);\n// after: bucket by day\nINSERT INTO events_by_day (user_id, day, ts, payload) VALUES (?, ?, ?, ?);","handlingStrategy":"validation","validationCode":"// application-side partition size guard\nif (estimatePartitionBytes(key) + pendingWriteBytes > writeSizeWarnThreshold)\n    throw new IllegalStateException(\"write would exceed partition size warning threshold for \" + key);","typeGuard":null,"tryCatchPattern":"ResultSet rs = session.execute(write);\nfor (String w : rs.getExecutionInfo().getWarnings())\n    if (w.startsWith(\"Write to \")) partitionSizer.alert(w);","preventionTips":["Bound partition sizes with bucketed keys","Avoid unbounded collections/rows per partition","Alert on writeSizeWarnings metric"],"tags":["write","warnings","partition-size","coordinator"],"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-14T16:17:12.679Z"}