{"record":{"id":"c408c7f9ba7f6110","repo":"risingwavelabs/risingwave","slug":"cannot-alter-the-job-because-it-is-blocked-by-c","errorCode":null,"errorMessage":"Cannot alter the job {} because it is blocked by creating unreschedulable backfill jobs","messagePattern":"Cannot alter the job (.+?) because it is blocked by creating unreschedulable backfill jobs","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/meta/src/stream/stream_manager.rs","lineNumber":935,"sourceCode":"\n    pub(crate) async fn reschedule_streaming_job(\n        &self,\n        job_id: JobId,\n        policy: ReschedulePolicy,\n        deferred: bool,\n    ) -> MetaResult<()> {\n        let _reschedule_job_lock = self.reschedule_lock_write_guard().await;\n\n        let creating_jobs = self.metadata_manager.list_creating_jobs().await?;\n\n        if !creating_jobs.is_empty() {\n            let blocked_jobs = self\n                .metadata_manager\n                .collect_reschedule_blocked_jobs_for_creating_jobs(&creating_jobs, !deferred)\n                .await?;\n\n            if blocked_jobs.contains(&job_id) {\n                bail!(\n                    \"Cannot alter the job {} because it is blocked by creating unreschedulable backfill jobs\",\n                    job_id,\n                );\n            }\n        }\n\n        let commands = self\n            .scale_controller\n            .reschedule_inplace(HashMap::from([(job_id, policy)]))\n            .await?;\n\n        if !deferred {\n            let _source_pause_guard = self.source_manager.pause_tick().await;\n\n            for (database_id, command) in commands {\n                self.barrier_scheduler\n                    .run_command(database_id, command)\n                    .await?;","sourceCodeStart":917,"sourceCodeEnd":953,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/stream/stream_manager.rs#L917-L953","documentation":"When rescheduling (altering parallelism of) a streaming job, the meta node consults the set of creating jobs that are unreschedulable backfills (via collect_reschedule_blocked_jobs_for_creating_jobs). If the requested job_id is in that blocked set, altering it is refused because changing parallelism mid-backfill-creation would invalidate the backfill plan.","triggerScenarios":"Calling reschedule_streaming_job (e.g. via apply_post_backfill_parallelism / ALTER ... PARALLELISM) on a job that is still in CREATING state and is backed by an unreschedulable backfill, while the blocked-jobs predicate (!deferred or not) marks it blocked.","commonSituations":"Running `ALTER MATERIALIZED VIEW mv SET PARALLELISM = n` while the MV is still backfilling; automation scaling parallelism during create; reissuing a reschedule immediately after create before backfill completes.","solutions":["Wait until the job finishes creating/backfilling, then retry the parallelism change.","Create the job with the desired parallelism up front instead of altering it mid-creation.","If the reschedule is intentionally deferred, pass the deferred flag appropriately so the check allows it.","Use jobs with online-reschedulable backfill (e.g. non-scan backfill types) if rescheduling during creation is required."],"exampleFix":"// before: ALTER ... SET PARALLELISM = 4; issued during creation -> error\n// after: check state first, then alter\nSELECT state FROM rw_materialized_views WHERE name = 'mv';\n-- only when state = 'Created':\nALTER MATERIALIZED VIEW mv SET PARALLELISM = 4;","handlingStrategy":"try-catch","validationCode":"-- check job creation state before altering parallelism\nSELECT state FROM rw_streaming_jobs WHERE job_id = <id>;\n-- only proceed when state = 'Created'","typeGuard":null,"tryCatchPattern":"match alter_parallelism(id, n).await {\n    Err(e) if e.to_string().contains(\"blocked by creating unreschedulable backfill jobs\") => {\n        wait_until_job_created(id).await?;\n        alter_parallelism(id, n).await\n    }\n    other => other,\n}","preventionTips":["Wait for backfill/creation to complete before rescheduling.","Set the target parallelism at create time for backfill-heavy jobs.","If mid-creation scaling matters, prefer backfill modes that support online rescheduling.","Serialize automation-driven parallelism changes behind a job-state check."],"tags":["meta-node","parallelism","backfill","reschedule"],"backgroundTag":"invalid-state-transition","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"}