risingwavelabs/risingwave · warning

Cannot alter the job {} because it is blocked by creating un

Error message

Cannot alter the job {} because it is blocked by creating unreschedulable backfill jobs

What it means

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.

Source

Thrown at src/meta/src/stream/stream_manager.rs:935

    pub(crate) async fn reschedule_streaming_job(
        &self,
        job_id: JobId,
        policy: ReschedulePolicy,
        deferred: bool,
    ) -> MetaResult<()> {
        let _reschedule_job_lock = self.reschedule_lock_write_guard().await;

        let creating_jobs = self.metadata_manager.list_creating_jobs().await?;

        if !creating_jobs.is_empty() {
            let blocked_jobs = self
                .metadata_manager
                .collect_reschedule_blocked_jobs_for_creating_jobs(&creating_jobs, !deferred)
                .await?;

            if blocked_jobs.contains(&job_id) {
                bail!(
                    "Cannot alter the job {} because it is blocked by creating unreschedulable backfill jobs",
                    job_id,
                );
            }
        }

        let commands = self
            .scale_controller
            .reschedule_inplace(HashMap::from([(job_id, policy)]))
            .await?;

        if !deferred {
            let _source_pause_guard = self.source_manager.pause_tick().await;

            for (database_id, command) in commands {
                self.barrier_scheduler
                    .run_command(database_id, command)
                    .await?;

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Wait until the job finishes creating/backfilling, then retry the parallelism change.
  2. Create the job with the desired parallelism up front instead of altering it mid-creation.
  3. If the reschedule is intentionally deferred, pass the deferred flag appropriately so the check allows it.
  4. Use jobs with online-reschedulable backfill (e.g. non-scan backfill types) if rescheduling during creation is required.

Example fix

// before: ALTER ... SET PARALLELISM = 4; issued during creation -> error
// after: check state first, then alter
SELECT state FROM rw_materialized_views WHERE name = 'mv';
-- only when state = 'Created':
ALTER MATERIALIZED VIEW mv SET PARALLELISM = 4;
Defensive patterns

Strategy: try-catch

Validate before calling

-- check job creation state before altering parallelism
SELECT state FROM rw_streaming_jobs WHERE job_id = <id>;
-- only proceed when state = 'Created'

Try / catch

match alter_parallelism(id, n).await {
    Err(e) if e.to_string().contains("blocked by creating unreschedulable backfill jobs") => {
        wait_until_job_created(id).await?;
        alter_parallelism(id, n).await
    }
    other => other,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: "Invalid state transition" errors: "status must be X, actually Y", "already rejected/charging/uninstalled", "cannot ... while running" — what they mean when a library rejects your call — this error's family across 31 libraries.

Related errors


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