{"record":{"id":"b0587eaf125c9dc8","repo":"risingwavelabs/risingwave","slug":"cannot-create-batch-refresh-job-while-database-bar","errorCode":null,"errorMessage":"cannot create batch refresh job while database barrier is paused","messagePattern":"cannot create batch refresh job while database barrier is paused","errorType":"validation","errorClass":"MetaError","httpStatus":null,"severity":"error","filePath":"src/meta/src/barrier/checkpoint/state.rs","lineNumber":683,"sourceCode":"                    let (table_ids, node_actors) = self.collect_base_info();\n                    (\n                        Some(mutation),\n                        table_ids,\n                        None,\n                        node_actors,\n                        PostCollectCommand::barrier(),\n                    )\n                }\n            }\n            Some(Command::CreateStreamingJob {\n                mut info,\n                job_type: CreateStreamingJobType::BatchRefresh(mut batch_refresh_info),\n                cross_db_snapshot_backfill_info,\n            }) => {\n                notify_database_graph = false;\n                {\n                    if self.state.is_paused() {\n                        bail!(\"cannot create batch refresh job while database barrier is paused\");\n                    }\n                    let snapshot_epoch = barrier_info.prev_epoch();\n                    let job_id = info.stream_job_fragments.stream_job_id();\n                    let database_id = info.streaming_job.database_id();\n\n                    // 1. Fill snapshot backfill epochs.\n                    let snapshot_backfill_info = &mut batch_refresh_info.snapshot_backfill_info;\n                    for snapshot_backfill_epoch in snapshot_backfill_info\n                        .upstream_mv_table_id_to_backfill_epoch\n                        .values_mut()\n                    {\n                        assert_eq!(\n                            snapshot_backfill_epoch.replace(snapshot_epoch),\n                            None,\n                            \"must not set previously\"\n                        );\n                    }\n                    for fragment in info.stream_job_fragments.inner.fragments.values_mut() {","sourceCodeStart":665,"sourceCodeEnd":701,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/barrier/checkpoint/state.rs#L665-L701","documentation":"A batch refresh (CreateStreamingJobType::BatchRefresh) job creation command was applied while the database's barrier state is paused. Batch refresh depends on a stable barrier snapshot epoch (prev_epoch), so the system rejects the operation until barriers resume.","triggerScenarios":"Applying a CREATE batch refresh job command via handle_new_barrier while the database is paused (e.g. after ALTER DATABASE ... PAUSE or an ongoing pause-based operation).","commonSituations":"User runs batch refresh while the database is paused for maintenance; another operation (e.g. schema change) left the database paused; script paused a database and forgot to resume before refreshing.","solutions":["Resume the database (ALTER DATABASE ... RESUME) and retry the batch refresh","Check the pause state before submitting batch refresh","Wait for any pause-based operations (schema changes, backfills) to complete"],"exampleFix":"-- before\nALTER DATABASE db PAUSE;\nCREATE ... BATCH REFRESH ...;\n-- after\nALTER DATABASE db RESUME;\nCREATE ... BATCH REFRESH ...;","handlingStrategy":"validation","validationCode":"if database_state.is_paused() {\n    return Err(\"resume database before batch refresh\");\n}\nsubmit_batch_refresh();","typeGuard":"fn can_batch_refresh(state: &BarrierState) -> bool { !state.is_paused() }","tryCatchPattern":"match create_batch_refresh(...).await {\n    Err(e) if e.contains(\"barrier is paused\") => resume_and_retry(),\n    other => other,\n}","preventionTips":["Check pause state before submitting batch refresh","Automate resume after pause-based maintenance ops","Serialize DDL to avoid conflicting pauses"],"tags":["meta","barrier","batch-refresh","paused"],"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"}