apache/cassandra · warning
Deserialized partition cell count histogram with
Error message
Deserialized partition cell count histogram with {} values greater than the maximum of {}. Clearing the overflow bucket to allow for degraded mean and percentile calculations... What it means
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.
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
Example fix
null
Defensive patterns
Strategy: validation
Validate before calling
EstimatedHistogram cellCounts = StatsMetadata.serializer.deserialize(version, in);
if (cellCounts.isOverflowed()) {
logger.warn("Cell count histogram overflowed: {} values beyond max {}", cellCounts.overflowCount(), cellCounts.getLargestBucketOffset());
cellCounts.clearOverflow();
} Type guard
boolean isHistogramUsable(EstimatedHistogram h) { return h != null && !h.isOverflowed(); } Try / catch
try { StatsMetadata sm = StatsMetadata.serializer.deserialize(version, in); } catch (IOException e) { /* treat sstable metadata as corrupt, trigger repair */ } Prevention
- 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
When it happens
Trigger: Reading -Statistics.db metadata where partition cell counts exceeded the EstimatedHistogram's maximum bucket when written (tables with very wide rows).
Common situations: Tables with extremely wide partitions (millions of cells per partition); schema migrations or compaction history from clusters with different workloads.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- Deserialized partition size histogram with
- Corrupt flags value for clustering prefix (isStatic flag…
- Invalid large Columns subset: missing index
- Invalid large Columns subset: present index
- Cannot deserialize index summary from
AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10).
Data as JSON: /api/errors/7765fc8c54faf156.
Report an issue: GitHub.
Appendix: source
Thrown at src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:541
public StatsMetadata deserialize(Version version, DataInputPlus in) throws IOException
{
EstimatedHistogram partitionSizes = EstimatedHistogram.serializer.deserialize(in);
if (partitionSizes.isOverflowed())
{
logger.warn("Deserialized partition size histogram with {} values greater than the maximum of {}. " +
"Clearing the overflow bucket to allow for degraded mean and percentile calculations...",
partitionSizes.overflowCount(), partitionSizes.getLargestBucketOffset());
partitionSizes.clearOverflow();
}
EstimatedHistogram columnCounts = EstimatedHistogram.serializer.deserialize(in);
if (columnCounts.isOverflowed())
{
logger.warn("Deserialized partition cell count histogram with {} values greater than the maximum of {}. " +
"Clearing the overflow bucket to allow for degraded mean and percentile calculations...",
columnCounts.overflowCount(), columnCounts.getLargestBucketOffset());
columnCounts.clearOverflow();
}
CommitLogPosition commitLogLowerBound = CommitLogPosition.NONE, commitLogUpperBound;
commitLogUpperBound = CommitLogPosition.serializer.deserialize(in);
long minTimestamp = in.readLong();
long maxTimestamp = in.readLong();
long minLocalDeletionTime;
long maxLocalDeletionTime;
if (version.hasUIntDeletionTime())
{
minLocalDeletionTime = Cell.deletionTimeUnsignedIntegerToLong(in.readInt());
maxLocalDeletionTime = Cell.deletionTimeUnsignedIntegerToLong(in.readInt());
}
elseView on GitHub (pinned to 88fd0f6a0e)