{"record":{"id":"e26d5fef42355463","repo":"risingwavelabs/risingwave","slug":"specified-parallelism-n-should-not-exceed-max-pa","errorCode":null,"errorMessage":"specified parallelism {n} should not exceed max parallelism {max_parallelism}","messagePattern":"specified parallelism (.+?) should not exceed max parallelism (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/stream/scale.rs","lineNumber":246,"sourceCode":"        let inner = self.metadata_manager.catalog_controller.inner.write().await;\n        let txn = inner.db.begin().await?;\n\n        for (table_id, target) 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            match &target {\n                ReschedulePolicy::Parallelism(p) | ReschedulePolicy::Both(p, _) => {\n                    if let StreamingParallelism::Fixed(n) = p.parallelism\n                        && n > max_parallelism as usize\n                    {\n                        bail!(format!(\n                            \"specified parallelism {n} should not exceed max parallelism {max_parallelism}\"\n                        ));\n                    }\n\n                    streaming_job.parallelism = Set(p.parallelism.clone());\n                    if matches!(p.parallelism, StreamingParallelism::Fixed(_)) {\n                        streaming_job.adaptive_parallelism_strategy = Set(None);\n                    } else {\n                        streaming_job.adaptive_parallelism_strategy =\n                            Set(p.adaptive_parallelism_strategy.clone());\n                    }\n                }\n                _ => {}\n            }\n\n            match &target {\n                ReschedulePolicy::ResourceGroup(r) | ReschedulePolicy::Both(_, r) => {\n                    streaming_job.specific_resource_group = Set(r.resource_group.clone());","sourceCodeStart":228,"sourceCodeEnd":264,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/stream/scale.rs#L228-L264","documentation":"`reschedule_inplace` applies a `ReschedulePolicy::Parallelism` (or `Both`) to a streaming job. When the policy uses `StreamingParallelism::Fixed(n)` and `n` exceeds the job's `max_parallelism` limit, the meta service rejects the reschedule with this error instead of silently over-parallelizing the job.","triggerScenarios":"Submitting an ALTER/RESCHEDULE request with `parallelism = fixed(n)` where `n > max_parallelism` of the streaming job — e.g. `ALTER TABLE t SET PARALLELISM = 16` on a job created with max parallelism 8, or a `Both` policy carrying an over-limit fixed parallelism.","commonSituations":"Operator sizing a job's parallelism above the cluster/job limit defined at creation; copy-pasting parallelism settings between jobs with different max_parallelism; increasing parallelism after the max was lowered.","solutions":["Query the job's max_parallelism (e.g. via SHOW / rw_catalog) and set a fixed parallelism <= that value.","Use `Adaptive` parallelism instead of `Fixed` so the framework picks a legal value.","If a higher fixed parallelism is genuinely needed, recreate the job with a larger max_parallelism, then reschedule."],"exampleFix":"// before\nALTER TABLE t SET PARALLELISM = 16;\n// after (with max_parallelism = 8)\nALTER TABLE t SET PARALLELISM = 8;","handlingStrategy":"validation","validationCode":"// look up max_parallelism (e.g. from rw_catalog.rw_streaming_jobs) before issuing the reschedule\nlet max = get_job_max_parallelism(job_id).await?;\nif let StreamingParallelism::Fixed(n) = &policy.parallelism {\n    if *n > max { return Err(format!(\"requested {n} exceeds max {max}\")); }\n}","typeGuard":null,"tryCatchPattern":"match reschedule(job_id, policy).await {\n    Err(e) if e.to_string().contains(\"should not exceed max parallelism\") => {\n        // fall back to a legal value\n        reschedule(job_id, policy.with_fixed(max_parallelism)).await?\n    }\n    r => r?,\n}","preventionTips":["Query the job's max_parallelism from the catalog before setting a fixed parallelism.","Prefer Adaptive parallelism when the optimal value is unknown.","Document max_parallelism alongside job settings so operators don't guess."],"tags":["reschedule","parallelism","validation"],"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"}