{"record":{"id":"7765fc8c54faf156","repo":"apache/cassandra","slug":"deserialized-partition-cell-count-histogram-with","errorCode":null,"errorMessage":"Deserialized partition cell count histogram with {} values greater than the maximum of {}. Clearing the overflow bucket to allow for degraded mean and percentile calculations...","messagePattern":"Deserialized partition cell count histogram with (.+?) values greater than the maximum of (.+?)\\. Clearing the overflow bucket to allow for degraded mean and percentile calculations\\.\\.\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java","lineNumber":541,"sourceCode":"\n        public StatsMetadata deserialize(Version version, DataInputPlus in) throws IOException\n        {\n            EstimatedHistogram partitionSizes = EstimatedHistogram.serializer.deserialize(in);\n\n            if (partitionSizes.isOverflowed())\n            {\n                logger.warn(\"Deserialized partition size histogram with {} values greater than the maximum of {}. \" +\n                            \"Clearing the overflow bucket to allow for degraded mean and percentile calculations...\",\n                            partitionSizes.overflowCount(), partitionSizes.getLargestBucketOffset());\n\n                partitionSizes.clearOverflow();\n            }\n\n            EstimatedHistogram columnCounts = EstimatedHistogram.serializer.deserialize(in);\n\n            if (columnCounts.isOverflowed())\n            {\n                logger.warn(\"Deserialized partition cell count histogram with {} values greater than the maximum of {}. \" +\n                            \"Clearing the overflow bucket to allow for degraded mean and percentile calculations...\",\n                            columnCounts.overflowCount(), columnCounts.getLargestBucketOffset());\n\n                columnCounts.clearOverflow();\n            }\n\n            CommitLogPosition commitLogLowerBound = CommitLogPosition.NONE, commitLogUpperBound;\n            commitLogUpperBound = CommitLogPosition.serializer.deserialize(in);\n            long minTimestamp = in.readLong();\n            long maxTimestamp = in.readLong();\n            long minLocalDeletionTime;\n            long maxLocalDeletionTime;\n            if (version.hasUIntDeletionTime())\n            {\n                minLocalDeletionTime = Cell.deletionTimeUnsignedIntegerToLong(in.readInt());\n                maxLocalDeletionTime = Cell.deletionTimeUnsignedIntegerToLong(in.readInt());\n            }\n            else","sourceCodeStart":523,"sourceCodeEnd":559,"githubUrl":"https://github.com/apache/cassandra/blob/88fd0f6a0eaed8943f05ac9e8f947882b8ddc8f1/src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java#L523-L559","documentation":"Same overflow handling as the partition-size histogram, but for the per-partition cell-count histogram in StatsMetadata. Deserialization finds cell counts above the histogram's largest bucket, logs a warning, and clears the overflow bucket so statistics remain computable though degraded.","triggerScenarios":"Reading -Statistics.db metadata where partition cell counts exceeded the EstimatedHistogram's maximum bucket when written (tables with very wide rows).","commonSituations":"Tables with extremely wide partitions (millions of cells per partition); schema migrations or compaction history from clusters with different workloads.","solutions":["Inspect for wide partitions using `nodetool toppartitions` and adjust the data model or bucketing","Compact the affected sstables to regenerate histograms","Accept degraded stats if data correctness is confirmed","Rebuild the table from other replicas if corruption is suspected"],"exampleFix":"null","handlingStrategy":"validation","validationCode":"EstimatedHistogram cellCounts = StatsMetadata.serializer.deserialize(version, in);\nif (cellCounts.isOverflowed()) {\n    logger.warn(\"Cell count histogram overflowed: {} values beyond max {}\", cellCounts.overflowCount(), cellCounts.getLargestBucketOffset());\n    cellCounts.clearOverflow();\n}","typeGuard":"boolean isHistogramUsable(EstimatedHistogram h) { return h != null && !h.isOverflowed(); }","tryCatchPattern":"try { StatsMetadata sm = StatsMetadata.serializer.deserialize(version, in); } catch (IOException e) { /* treat sstable metadata as corrupt, trigger repair */ }","preventionTips":["Keep cell counts per partition bounded via data model design","Compact regularly so histograms reflect the current data","Watch for wide-partition warnings in logs"],"tags":["sstable","histogram","io","deserialization"],"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-17T15:17:12.973Z"}