{"record":{"id":"08db34aabed564d7","repo":"risingwavelabs/risingwave","slug":"cannot-use-a-different-max-parallelism-when-replac","errorCode":null,"errorMessage":"cannot use a different max parallelism when replacing streaming job, original: {}, new: {}","messagePattern":"cannot use a different max parallelism when replacing streaming job, original: (.+?), new: (.+?)","errorType":"validation","errorClass":"MetaError","httpStatus":null,"severity":"error","filePath":"src/meta/src/controller/streaming_job.rs","lineNumber":1616,"sourceCode":"        if batch_refresh_dep_cnt != 0 {\n            return Err(MetaError::permission_denied(\n                \"replacing a table with dependent batch refresh materialized views is not supported\",\n            ));\n        }\n\n        // 3. check parallelism.\n        let original_job = StreamingJobModel::find_by_id(id)\n            .one(&txn)\n            .await?\n            .map(ReplaceOriginalJobInfo::from)\n            .ok_or_else(|| MetaError::catalog_id_not_found(streaming_job.job_type_str(), id))?;\n\n        if let Some(max_parallelism) = expected_original_max_parallelism\n            && original_job.max_parallelism != max_parallelism as i32\n        {\n            // We already override the max parallelism in `StreamFragmentGraph` before entering this function.\n            // This should not happen in normal cases.\n            bail!(\n                \"cannot use a different max parallelism \\\n                 when replacing streaming job, \\\n                 original: {}, new: {}\",\n                original_job.max_parallelism,\n                max_parallelism\n            );\n        }\n\n        let parallelism = original_job.resolved_parallelism(specified_parallelism);\n        let ctx = original_job.stream_context(ctx);\n        let adaptive_parallelism_strategy = original_job\n            .adaptive_parallelism_strategy\n            .as_deref()\n            .map(|s| parse_strategy(s).expect(\"strategy should be validated before persisting\"));\n        let resource_type = original_job.resource_type();\n        let belong_to_oid = Object::find_by_id(id)\n            .select_only()\n            .column(object::Column::BelongToOid)","sourceCodeStart":1598,"sourceCodeEnd":1634,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/controller/streaming_job.rs#L1598-L1634","documentation":"Replacing a streaming job requires the new definition to use the same max parallelism as the original job, because parallelism affects fragment/actor layout. The expected original max parallelism supplied does not match the persisted job's value.","triggerScenarios":"create_job_catalog_for_replace where expected_original_max_parallelism is Some(n) but original_job.max_parallelism != n as i32.","commonSituations":"Altering a MV/table/sink with a different MAX PARALLELISM than the original; frontend failing to carry over parallelism settings; session default parallelism changed between create and replace.","solutions":["Use the same MAX PARALLELISM as the original job in the ALTER/replace statement.","Omit the parallelism override so it defaults to the original job's value.","Check session/database default parallelism settings that may inject a different value.","If a parallelism change is genuinely needed, drop and recreate the job instead of replacing."],"exampleFix":"-- before\nALTER TABLE mv_orders SET MAX PARALLELISM = 32;\n-- after (match original parallelism, e.g. 16)\nALTER TABLE mv_orders SET MAX PARALLELISM = 16;","handlingStrategy":"validation","validationCode":"-- match original parallelism before replace\nSELECT max_parallelism FROM rw_streaming_jobs WHERE job_id = <original_job_id>;\n-- then use the same MAX PARALLELISM in the ALTER statement","typeGuard":null,"tryCatchPattern":"match replace_streaming_job(..).await {\n    Err(e) if e.to_string().contains(\"different max parallelism\") => /* retry with the original job's max parallelism */,\n    other => other?,\n}","preventionTips":["Carry over original max_parallelism in replace requests","Avoid changing session default parallelism between create and replace","Drop+recreate if parallelism change is required"],"tags":["meta","replace","parallelism"],"backgroundTag":"conflicting-config-options","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"}