{"record":{"id":"1fb1aebf584a23c8","repo":"risingwavelabs/risingwave","slug":"database-database-id-does-not-exist-while-handli","errorCode":null,"errorMessage":"database {database_id} does not exist while handling command {command:?}","messagePattern":"database (.+?) does not exist while handling command (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/barrier/checkpoint/control.rs","lineNumber":346,"sourceCode":"                    | Command::SourceChangeSplit(_)\n                    | Command::Throttle { .. }\n                    | Command::CreateSubscription { .. }\n                    | Command::AlterSubscriptionRetention { .. }\n                    | Command::ConnectorPropsChange(_)\n                    | Command::Refresh { .. }\n                    | Command::ListFinish { .. }\n                    | Command::LoadFinish { .. }\n                    | Command::ResetSource { .. }\n                    | Command::ResumeBackfill { .. }\n                    | Command::InjectSourceOffsets { .. } => {\n                        if cfg!(debug_assertions) {\n                            panic!(\n                                \"new database graph info can only be created for normal creating streaming job, but get command: {} {:?}\",\n                                database_id, command\n                            )\n                        } else {\n                            warn!(%database_id, ?command, \"database does not exist while handling the command\");\n                            notifier.notify_start_failed(anyhow!(\"database {database_id} does not exist while handling command {command:?}\").into());\n                            return Ok(());\n                        }\n                    }\n                },\n            };\n\n            database.handle_new_barrier(\n                Some((command, notifier)),\n                checkpoint,\n                span,\n                partial_graph_manager,\n                &self.hummock_version_stats,\n                worker_nodes,\n            )\n        } else {\n            let database = match self.databases.entry(database_id) {\n                Entry::Occupied(entry) => entry.into_mut(),\n                Entry::Vacant(_) => {","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/barrier/checkpoint/control.rs#L328-L364","documentation":"While handling a command that needs a database's inflight graph info, the controller cannot find the database in its checkpoint state. The start of the affected job is failed via notify_start_failed because there is no database graph to apply the command to.","triggerScenarios":"A create/reschedule command references database_id that has been dropped (or never registered) by the time handle_new_barrier processes it — e.g. DROP DATABASE raced with a pending CREATE job in that database.","commonSituations":"Dropping a database while streaming jobs are still being created in it; concurrent DDL racing barrier scheduling; stale command queued after database deletion.","solutions":["Check whether the database was dropped concurrently; re-create it and re-issue the job.","Retry the CREATE statement after confirming the database exists.","Avoid issuing DROP DATABASE while creation jobs are in-flight in that database."],"exampleFix":"-- before: racing drop\nDROP DATABASE db1;\n-- after: wait for pending creations\nSHOW JOBS IN DATABASE db1; -- ensure none creating\nDROP DATABASE db1;","handlingStrategy":"validation","validationCode":"-- ensure db exists and has no dropping race before creating jobs\nSELECT 1 FROM rw_databases WHERE database_id = <id>;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Don't DROP DATABASE while creation jobs are in-flight in it.","Check SHOW JOBS IN DATABASE before issuing DDL there.","Retry failed CREATEs after confirming the database exists."],"tags":["barrier","database","race-condition","streaming-job"],"backgroundTag":"entity-not-found","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"}