risingwavelabs/risingwave · error · SinkError::Config

`compaction.delete_files_count_threshold` must be greater th

Error message

`compaction.delete_files_count_threshold` must be greater than 0

What it means

Numeric option validation in IcebergSinkConfig::from_btreemap: `compaction.delete_files_count_threshold` was set to 0, meaning compaction would trigger on any delete-file presence. The guard enforces a strictly positive threshold when the sink config is built from with-clause properties.

Source

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

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

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

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

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

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

        if config.write_parquet_max_row_group_rows == Some(0) {
            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!(

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Set `delete_files_count_threshold` to a positive integer, e.g. 10.
  2. Remove the option to use the default.

Example fix

// before
WITH (connector = 'iceberg', delete_files_count_threshold = 0)
// after
WITH (connector = 'iceberg', delete_files_count_threshold = 10)
Defensive patterns

Strategy: validation

Validate before calling

if (opts.delete_files_count_threshold != null && Number(opts.delete_files_count_threshold) <= 0) {
  throw new Error('`compaction.delete_files_count_threshold` must be greater than 0');
}

Type guard

function isValidOptionalPositive(v) {
  return v == null || (Number.isInteger(v) && v > 0);
}

Try / catch

try {
  await createIcebergSink(opts);
} catch (e) {
  if (String(e).includes('delete_files_count_threshold')) {
    delete opts.delete_files_count_threshold;
    return createIcebergSink(opts);
  }
  throw e;
}

Prevention

When it happens

Trigger: CREATE SINK with `compaction.delete_files_count_threshold = 0` in the WITH options.

Common situations: Zero placeholder in tooling; misunderstanding that 0 disables delete-file compaction; bulk-edited config files.

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/522f8e4dcb96caf6. Report an issue: GitHub.