risingwavelabs/risingwave · error · ParallelismStrategyParseError

Unsupported strategy: {0}

Error message

Unsupported strategy: {0}

What it means

ParallelismStrategyParseError::UnsupportedStrategy is raised when parsing an adaptive parallelism strategy parameter whose leading strategy name is not one of the supported ones (Bounded or Ratio). The parser in src/common/src/system_param/adaptive_parallelism_strategy.rs expects input like 'bounded(8)' or 'ratio(0.5)'; any other leading token yields this error with the raw input.

Source

Thrown at src/common/src/system_param/adaptive_parallelism_strategy.rs:64

    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        match self {
            AdaptiveParallelismStrategy::Auto => write!(f, "AUTO"),
            AdaptiveParallelismStrategy::Full => write!(f, "FULL"),
            AdaptiveParallelismStrategy::Bounded(n) => write!(f, "BOUNDED({})", n),
            AdaptiveParallelismStrategy::Ratio(r) => write!(f, "RATIO({})", r),
        }
    }
}

impl From<AdaptiveParallelismStrategy> for String {
    fn from(val: AdaptiveParallelismStrategy) -> Self {
        val.to_string()
    }
}

#[derive(Error, Debug)]
pub enum ParallelismStrategyParseError {
    #[error("Unsupported strategy: {0}")]
    UnsupportedStrategy(String),

    #[error("Parse error: {0}")]
    ParseIntError(#[from] std::num::ParseIntError),

    #[error("Parse error: {0}")]
    ParseFloatError(#[from] std::num::ParseFloatError),

    #[error("Invalid value for Bounded strategy: must be positive integer")]
    InvalidBoundedValue,

    #[error("Invalid value for Ratio strategy: must be between 0.0 and 1.0")]
    InvalidRatioValue,
}

impl AdaptiveParallelismStrategy {
    pub fn compute_target_parallelism(&self, current_parallelism: usize) -> usize {
        match self {

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Use 'bounded(<positive integer>)' or 'ratio(<0.0-1.0 float>)' as the strategy value.
  2. Fix the strategy name spelling; only Bounded and Ratio strategies exist.
  3. Check the parameter docs (system parameter reference) for exact accepted syntax.

Example fix

// before
SET adaptive_parallelism_strategy = 'bound(4)';
// after
SET adaptive_parallelism_strategy = 'bounded(4)';
Defensive patterns

Strategy: validation

Validate before calling

// Validate adaptive strategy string before setting
fn is_valid_strategy(v: &str) -> bool {
    let v = v.trim();
    (v.starts_with("bounded(") && v.ends_with(')'))
        || (v.starts_with("ratio(") && v.ends_with(')'))
}

Try / catch

match AdaptiveParallelismStrategy::from_str(&value) {
    Err(ParallelismStrategyParseError::UnsupportedStrategy(s)) => {
        eprintln!("'{s}' unsupported; use bounded(<int>) or ratio(<0.0-1.0>)");
    }
    other => other?,
}

Prevention

When it happens

Trigger: Setting the adaptive parallelism strategy system parameter (e.g. 'SET system parameter adaptive_parallelism_strategy = ''random(3)''') with an unknown strategy name, or omitting the parentheses form entirely ('fast' instead of 'bounded(4)').

Common situations: Guessing strategy names; copying syntax from other systems; typos like 'bound(4)' or 'ration(0.5)'; case-sensitivity mistakes ('Bounded(4)' vs 'bounded(4)' depending on parser matching).

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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