risingwavelabs/risingwave · error · SinkError::Config

`manifest_rewrite_min_count_to_merge` must be greater than 0

Error message

`manifest_rewrite_min_count_to_merge` must be greater than 0

What it means

`from_btreemap` rejects `manifest_rewrite_min_count_to_merge` equal to 0. This option controls the minimum number of manifest files required before a rewrite/merge triggers; 0 is nonsensical for a minimum count and is treated as invalid config.

Solutions

  1. Set `manifest_rewrite_min_count_to_merge` to a positive integer (e.g. 100).
  2. Remove the option to use the default.
  3. Audit scripts generating sink properties for zero-filled numerics.
  4. Combine check with the sibling validations (row group bytes, target size) in a pre-submit config lint.

Example fix

// before
props.insert("manifest_rewrite_min_count_to_merge".to_string(), "0".to_string());
// after
props.insert("manifest_rewrite_min_count_to_merge".to_string(), "100".to_string());
Defensive patterns

Strategy: validation

Validate before calling

if let Some(n) = props.get("manifest_rewrite_min_count_to_merge") {
    if n.parse::<u64>()? == 0 { return Err("manifest_rewrite_min_count_to_merge must be > 0"); }
}

Type guard

fn valid_min_count(v: Option<u64>) -> bool { v.map_or(true, |n| n > 0) }

Prevention

When it happens

Trigger: Creating an Iceberg sink config whose properties include `manifest_rewrite_min_count_to_merge = 0`.

Common situations: Tuning compaction aggressiveness with zero to 'always merge', or config generators producing 0 for unset numeric fields.

Understand the failure class

Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/7f337518e809fb8b. Report an issue: GitHub.

Appendix: source

Thrown at src/connector/src/sink/iceberg/config.rs:685

            return Err(SinkError::Config(anyhow!(
                "`compaction.write_parquet_max_row_group_rows` must be greater than 0"
            )));
        }

        if config.write_parquet_max_row_group_bytes == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`compaction.write_parquet_max_row_group_bytes` must be greater than 0"
            )));
        }

        if config.manifest_rewrite_target_size_bytes == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`manifest_rewrite_target_size_bytes` must be greater than 0"
            )));
        }

        if config.manifest_rewrite_min_count_to_merge == Some(0) {
            return Err(SinkError::Config(anyhow!(
                "`manifest_rewrite_min_count_to_merge` must be greater than 0"
            )));
        }

        // Validate table identifier (e.g., database.name should not contain dots)
        config
            .table
            .validate()
            .map_err(|e| SinkError::Config(anyhow!(e)))?;

        if config.write_parquet_max_row_group_rows.is_some() {
            tracing::warn!(
                "`compaction.write_parquet_max_row_group_rows` is deprecated and ignored; use `compaction.write_parquet_max_row_group_bytes` instead"
            );
        }

        Ok(config)
    }

View on GitHub (pinned to 6469eb736d)