{"record":{"id":"b6c8e3dd6d24e3fe","repo":"risingwavelabs/risingwave","slug":"specified-backfill-parallelism-n-should-not-exce","errorCode":null,"errorMessage":"specified backfill parallelism {n} should not exceed max parallelism {max_parallelism}","messagePattern":"specified backfill parallelism (.+?) should not exceed max parallelism (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/stream/scale.rs","lineNumber":307,"sourceCode":"        let txn = inner.db.begin().await?;\n\n        for (table_id, policy) in &policy {\n            let streaming_job = StreamingJob::find_by_id(*table_id)\n                .one(&txn)\n                .await?\n                .ok_or_else(|| MetaError::catalog_id_not_found(\"table\", table_id))?;\n\n            let max_parallelism = streaming_job.max_parallelism;\n\n            let mut streaming_job = streaming_job.into_active_model();\n\n            if let Some(ParallelismPolicy {\n                parallelism: StreamingParallelism::Fixed(n),\n                ..\n            }) = policy\n                && *n > max_parallelism as usize\n            {\n                bail!(format!(\n                    \"specified backfill parallelism {n} should not exceed max parallelism {max_parallelism}\"\n                ));\n            }\n\n            if let Some(policy) = policy {\n                streaming_job.backfill_parallelism = Set(Some(policy.parallelism.clone()));\n                if matches!(policy.parallelism, StreamingParallelism::Fixed(_)) {\n                    streaming_job.backfill_adaptive_parallelism_strategy = Set(None);\n                } else {\n                    streaming_job.backfill_adaptive_parallelism_strategy =\n                        Set(policy.adaptive_parallelism_strategy.clone());\n                }\n            } else {\n                streaming_job.backfill_parallelism = Set(None);\n                streaming_job.backfill_adaptive_parallelism_strategy = Set(None);\n            }\n            streaming_job.update(&txn).await?;\n        }","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/stream/scale.rs#L289-L325","documentation":"`reschedule_backfill_parallelism_inplace` applies a backfill `ParallelismPolicy` to a streaming job. If the policy sets `StreamingParallelism::Fixed(n)` with `n` greater than the job's `max_parallelism`, the change is rejected with this error. It enforces that backfill parallelism stays within the job's upper bound.","triggerScenarios":"Calling the reschedule backfill parallelism API (e.g. `ALTER ... SET BACKFILL_PARALLELISM = n` or the corresponding `alter_streaming_job_backfill_parallelism` path) with a fixed `n > max_parallelism` of the job.","commonSituations":"Tuning backfill speed after a snapshot migration and picking a value above the job's max; misunderstanding that backfill parallelism is capped by job max_parallelism; copying settings from a job with a higher limit.","solutions":["Set backfill parallelism to a value <= the job's max_parallelism (check the catalog/SHOW output first).","Use Adaptive backfill parallelism instead of a fixed value.","If a larger fixed value is required, recreate the job with higher max_parallelism first."],"exampleFix":"// before\nALTER TABLE t SET BACKFILL_PARALLELISM = 32; -- max_parallelism is 12\n// after\nALTER TABLE t SET BACKFILL_PARALLELISM = 12;","handlingStrategy":"validation","validationCode":"let max = get_job_max_parallelism(job_id).await?;\nif let Some(policy) = &backfill_policy {\n    if let StreamingParallelism::Fixed(n) = policy.parallelism {\n        if n > max { return Err(format!(\"backfill {n} exceeds max {max}\")); }\n    }\n}","typeGuard":null,"tryCatchPattern":"match set_backfill_parallelism(job_id, policy).await {\n    Err(e) if e.to_string().contains(\"backfill parallelism\") => {\n        set_backfill_parallelism(job_id, policy.with_fixed(max_parallelism)).await?\n    }\n    r => r?,\n}","preventionTips":["Cap requested backfill parallelism at the job's max_parallelism.","Use Adaptive backfill parallelism unless a specific fixed value is required.","Remember backfill parallelism is bounded by job max_parallelism, not cluster size."],"tags":["reschedule","backfill","parallelism"],"backgroundTag":"value-out-of-range","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}