quickwit-oss/quickwit · error

input {} has partition_id {}, expected {}

Error message

input {} has partition_id {}, expected {}

What it means

merge_parquet_split_metadata requires all input splits to share the same `partition_id`. This bail fires when input i's partition_id differs from inputs[0]'s. Merging across partitions would corrupt the partition attribution of the output split, so this is a hard precondition enforced before assembling output metadata.

Source

Thrown at quickwit/quickwit-parquet-engine/src/merge/metadata_aggregation.rs:81

    for (i, input) in inputs.iter().enumerate().skip(1) {
        if input.kind != first.kind {
            bail!(
                "input {} has kind {:?}, expected {:?}",
                i,
                input.kind,
                first.kind
            );
        }
        if input.index_uid != first.index_uid {
            bail!(
                "input {} has index_uid '{}', expected '{}'",
                i,
                input.index_uid,
                first.index_uid
            );
        }
        if input.partition_id != first.partition_id {
            bail!(
                "input {} has partition_id {}, expected {}",
                i,
                input.partition_id,
                first.partition_id
            );
        }
        if input.sort_fields != first.sort_fields {
            bail!(
                "input {} has sort_fields '{}', expected '{}'",
                i,
                input.sort_fields,
                first.sort_fields
            );
        }
        if input.window != first.window {
            bail!(
                "input {} has window {:?}, expected {:?}",
                i,

View on GitHub (pinned to a39730c5cd)

Solutions

  1. Fix the merge selection query to filter by partition_id as well as index_uid and time range.
  2. After a repartitioning operation, re-tag or re-split legacy splits so each candidate set is single-partition.
  3. Add an assertion/filter at task-assignment time so mixed-partition candidate lists are rejected earlier with clearer context.
  4. In tests, generate all input splits from one partition_id constant.

Example fix

// before
if input.index_uid != first.index_uid { bail!(...); }
// after (partition check already exists; ensure selection filters too)
SELECT ... WHERE index_uid = $1 AND partition_id = $2 AND time_range && $3
Defensive patterns

Strategy: validation

Validate before calling

fn single_partition(inputs: &[ParquetSplitMetadata]) -> bool {
    inputs.iter().all(|s| s.partition_id == inputs[0].partition_id)
}

Type guard

fn same_partition(inputs: &[ParquetSplitMetadata]) -> Option<u32> {
    let pid = inputs.first()?.partition_id;
    inputs.iter().all(|s| s.partition_id == pid).then_some(pid)
}

Try / catch

if let Err(e) = merge_parquet_split_metadata(&inputs, &output, mixed) {
    if e.to_string().contains("partition_id") {
        warn!("mixed-partition merge rejected: {e:#}; re-grouping by partition");
        return regroup_and_retry(inputs);
    }
    return Err(e);
}

Prevention

When it happens

Trigger: Calling merge_parquet_split_metadata with inputs selected across different partition ids — e.g. a merge policy that only sorts by index_uid and time range but not partition_id, or split metadata loaded for the wrong partition task.

Common situations: Merge scheduler bug after partitioning scheme changes; repartitioning an index leaves old splits assigned to old partition ids that a broad query pulls into one merge task; hand-built test metadata mixing partition ids.

Understand the failure class

Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.

Related errors


AI-assisted analysis of quickwit-oss/quickwit@a39730c5cd (2026-09-08). Data as JSON: /api/errors/2030cac68dbb5575. Report an issue: GitHub.