apache/cassandra · warning

Deserialized partition size histogram with

Error message

Deserialized partition size histogram with {} values greater than the maximum of {}. Clearing the overflow bucket to allow for degraded mean and percentile calculations...

What it means

When deserializing an sstable's StatsMetadata, the partition-size EstimatedHistogram reports that its overflow bucket holds values beyond the largest representable bucket offset. Cassandra logs a warning and clears the overflow bucket so mean/percentile math does not blow up, at the cost of accuracy for the largest partitions.

Solutions

  1. Verify partition sizes with `nodetool tablehistograms` and consider `nodetool compact` to rewrite the sstable
  2. Check for extremely large partitions (`nodetool toppartitions` or scanning for big rows) and split them via a better partition key
  3. If only one sstable is affected and data is intact, treat as informational; metrics are degraded but correctness is unaffected
  4. If corruption is suspected, run a full repair/rebuild of the affected table from other replicas

Example fix

null
Defensive patterns

Strategy: validation

Validate before calling

EstimatedHistogram sizes = StatsMetadata.serializer.deserialize(version, in);
if (sizes.isOverflowed()) {
    logger.warn("Partition size histogram overflowed: {} values beyond max {}", sizes.overflowCount(), sizes.getLargestBucketOffset());
    sizes.clearOverflow(); // degraded stats, data still safe
}

Type guard

boolean isHistogramUsable(EstimatedHistogram h) { return h != null && !h.isOverflowed(); }

Try / catch

try { StatsMetadata sm = StatsMetadata.serializer.deserialize(version, in); } catch (IOException e) { /* corrupted -Statistics.db: quarantine sstable, rebuild from replicas */ }

Prevention

When it happens

Trigger: Reading the StatsMetadata component of an sstable whose partition sizes exceeded the histogram's maximum tracked value when it was written (e.g. very large partitions, or histograms written by older/other versions).

Common situations: Upgrading clusters with very large partitions; restoring sstables from clusters with different partition-size distributions; corrupted or partially-written -Statistics.db components.

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


AI-assisted analysis of apache/cassandra@88fd0f6a0e (2026-09-10). Data as JSON: /api/errors/811fa83b6bd9c21a. Report an issue: GitHub.

Appendix: source

Thrown at src/java/org/apache/cassandra/io/sstable/metadata/StatsMetadata.java:530

        }

        private void serializeImprovedMinMax(Version version, StatsMetadata component, DataOutputPlus out) throws IOException
        {
            assert component.clusteringTypes != null;
            typeSerializer.serializeList(component.clusteringTypes, out);
            Slice.serializer.serialize(component.coveredClustering,
                                       out,
                                       version.correspondingMessagingVersion(),
                                       component.clusteringTypes);
        }

        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;

View on GitHub (pinned to 88fd0f6a0e)