risingwavelabs/risingwave · error · Error

compaction group error: {0}

Error message

compaction group error: {0}

What it means

hummock::Error::CompactionGroup(String) carries a failure from the compaction-group subsystem: partitioning SSTables/tables into compaction groups and managing their configurations. The payload string describes the specific problem (e.g. invalid group membership, missing group config, illegal operation on a compaction group) returned by the compaction group manager used by Hummock meta.

Source

Thrown at src/meta/src/hummock/error.rs:44

#[derive(Error, Debug)]
pub enum Error {
    #[error("invalid hummock context {0}")]
    InvalidContext(HummockContextId),
    #[error("failed to access meta store")]
    MetaStore(
        #[source]
        #[backtrace]
        anyhow::Error,
    ),
    #[error(transparent)]
    ObjectStore(
        #[from]
        #[backtrace]
        ObjectError,
    ),
    #[error("compactor {0} is disconnected")]
    CompactorUnreachable(HummockContextId),
    #[error("compaction group error: {0}")]
    CompactionGroup(String),
    #[error("SST {0} is invalid")]
    InvalidSst(HummockSstableObjectId),
    #[error("invalid manual compaction option: {0}")]
    InvalidManualCompactionOption(String),
    #[error("invalid epoch range: {start_epoch}..={end_epoch}")]
    InvalidEpochRange { start_epoch: u64, end_epoch: u64 },
    #[error("time-travel version expired: table {table_id}, epoch {epoch}")]
    TimeTravelVersionExpired { table_id: TableId, epoch: u64 },
    #[error("time travel")]
    TimeTravel(
        #[source]
        #[backtrace]
        anyhow::Error,
    ),
    #[error(transparent)]
    Internal(
        #[from]

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Read the payload string to see the exact compaction-group failure
  2. Verify the table/SST's compaction group membership and that the target group exists
  3. Re-check the compaction config values used (invalid ones feed into this error path)
  4. Retry the group update after transient DDL races settle
  5. Reset the affected table's compaction settings to defaults and reapply

Example fix

// before
let group_id = group_manager.get_group_of(table_id).unwrap(); // panics if missing
// after
match group_manager.get_group_of(table_id) {
    Some(group_id) => Ok(group_id),
    None => Err(hummock::Error::CompactionGroup(format!(
        "table {table_id} has no compaction group; assign default"
    ))),
}
Defensive patterns

Strategy: validation

Validate before calling

// Validate compaction group config before applying
fn validate_group_update(table_id: TableId, cfg: &TableOption) -> Result<(), String> {
    if cfg.target_group.is_some() && cfg.is_index() {
        return Err("index tables cannot be moved to a custom compaction group".into());
    }
    Ok(())
}

Type guard

fn is_compaction_group_error(e: &hummock::Error) -> Option<&str> {
    match e { hummock::Error::CompactionGroup(msg) => Some(msg.as_str()), _ => None }
}

Try / catch

match update_result {
    Err(hummock::Error::CompactionGroup(msg)) => {
        tracing::error!("compaction group update rejected: {msg}");
        // fall back to default compaction settings for the table
    }
    other => other?,
}

Prevention

When it happens

Trigger: Updating or creating compaction group configs via the compaction group manager (e.g. `CompactionGroupManager::try_update_compaction_group` on table creation/drop); requesting a compaction group that does not exist; conflicting group settings for a table id; internal invariant checks inside the group manager failing.

Common situations: Tuning compaction via ALTER TABLE/compaction config with invalid settings; tables referencing groups removed after cleanup; races between table drop and compaction group membership updates; upgrades changing compaction-group config format.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


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