influxdata/influxdb · warning

row count overflows i64

Error message

row count overflows i64

What it means

to_parquet_file stores the row count as row_count.try_into().expect("row count overflows i64") — a u64-to-i64 conversion that fails only above i64::MAX (~9.2 quintillion) rows. Parquet row counts originate as i64 in the footer, so a value that overflows cannot be produced by a real file; this expect is a defensive bound, effectively unreachable.

Source

Thrown at core/parquet_file/src/metadata.rs:491

        let columns: Vec<_> = stats.iter().map(|v| column_id_map(&v.name)).collect();

        // Extract the min/max timestamps.
        let TimestampRange {
            min: min_time,
            max: max_time,
        } = derive_min_max_time(stats);

        ParquetFileParams {
            namespace_id: self.namespace_id,
            table_id: self.table_id,
            partition_id,
            partition_hash_id,
            object_store_id: self.object_store_id,
            min_time,
            max_time,
            file_size_bytes: file_size_bytes as i64,
            compaction_level: self.compaction_level,
            row_count: row_count.try_into().expect("row count overflows i64"),
            column_set: ColumnSet::new(columns),
            max_l0_created_at: self.max_l0_created_at,
            // Currently, we're only setting the `source` field if the Parquet file is being
            // created by bulk ingest, which does not use this code path. So for now, always set
            // `source` to `None` here.
            source: None,
        }
    }

    /// Estimate the memory consumption of this object and its contents
    pub fn size(&self) -> usize {
        // size of this structure, including inlined size + heap sizes
        let size_without_sortkey_refs = mem::size_of_val(self)
            + self.namespace_name.len()
            + self.table_name.len()
            + std::mem::size_of::<PartitionKey>();

        if let Some(sort_key) = self.sort_key.as_ref() {

View on GitHub (pinned to d28e26e048)

Solutions

  1. If hit, suspect data corruption of the metadata blob itself — re-verify the object and its checksums.
  2. In fuzzing/harness code, bound or reject absurd row_count values before invoking to_parquet_file.
  3. No production change is warranted; treat as an invariant assert.
Defensive patterns

Strategy: validation

Validate before calling

// if you feed crafted metadata (fuzzing/harnesses), bound the row count first
fn row_count_fits_i64(m: &IoxParquetMetaData) -> bool {
    matches!(u64::try_from(m.decode().map(|d| d.row_count()).unwrap_or(0)), Ok(n) if n <= i64::MAX as u64)
}

Prevention

When it happens

Trigger: Only a fabricated DecodedIoxParquetMetaData reporting > i64::MAX rows (hand-crafted metadata bytes or memory corruption). Genuine parquet footers cannot carry such counts.

Common situations: Practically never in production; conceivable in fuzz tests feeding mutated metadata blobs, or if a future format changes row-count widths.

Related errors


AI-assisted analysis of influxdata/influxdb@d28e26e048 (2026-08-16). Data as JSON: /api/errors/7375d8f89bed7a07. Report an issue: GitHub.