{"record":{"id":"3e3a54d58c450496","repo":"risingwavelabs/risingwave","slug":"database-of-cross-db-upstream-table-not-found","errorCode":null,"errorMessage":"database of cross db upstream table {} not found","messagePattern":"database of cross db upstream table (.+?) not found","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/barrier/checkpoint/control.rs","lineNumber":278,"sourceCode":"                        if let Some(database) = database.running_state()\n                            && database.database_info.contains_job(table_id.as_job_id())\n                        {\n                            if let Some(committed_epoch) = database.committed_epoch {\n                                *snapshot_epoch = Some(committed_epoch);\n                            }\n                            break;\n                        }\n                    }\n                    if snapshot_epoch.is_none() {\n                        let table_id = *table_id;\n                        warn!(\n                            ?cross_db_snapshot_backfill_info,\n                            ?table_id,\n                            ?info,\n                            \"database of cross db upstream table not found\"\n                        );\n                        let err: MetaError =\n                            anyhow!(\"database of cross db upstream table {} not found\", table_id)\n                                .into();\n                        notifier.notify_start_failed(err);\n\n                        return Ok(());\n                    }\n                }\n            }\n\n            let database = match self.databases.entry(database_id) {\n                Entry::Occupied(entry) => entry\n                    .into_mut()\n                    .expect_running(\"should not have command when not running\"),\n                Entry::Vacant(entry) => match &command {\n                    Command::CreateStreamingJob { info, job_type, .. } => {\n                        let CreateStreamingJobType::Normal = job_type else {\n                            if cfg!(debug_assertions) {\n                                panic!(\n                                    \"unexpected first job of type {job_type:?} with info {info:?}\"","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/barrier/checkpoint/control.rs#L260-L296","documentation":"While handling a new barrier, a streaming job with a cross-database snapshot backfill references an upstream table whose owning database cannot be found. The barrier controller fails the job via the notifier (notify_start_failed) because it cannot resolve the upstream database needed for the cross-DB backfill snapshot.","triggerScenarios":"Creating a streaming job whose backfill reads a table in another database, and the upstream table's database_id no longer resolves in the meta catalog at barrier time (database dropped, or catalog entry missing).","commonSituations":"Upstream database was dropped concurrently while the cross-DB backfill job was being created; corrupted catalog after a restore; referencing a table whose database was renamed/dropped between CREATE and the first barrier.","solutions":["Verify the upstream database still exists (SHOW DATABASES) and recreate it if it was dropped.","Re-create the streaming job after confirming the upstream table/database exists.","If occurring after restore, verify catalog integrity of the restored metadata."],"exampleFix":"-- before: upstream db dropped mid-creation\nCREATE MATERIALIZED VIEW mv AS SELECT * FROM other_db.t;\n-- after: ensure db exists first\nCREATE DATABASE IF NOT EXISTS other_db;\nCREATE MATERIALIZED VIEW mv AS SELECT * FROM other_db.t;","handlingStrategy":"validation","validationCode":"-- confirm upstream db/table exist before cross-db backfill DDL\nSELECT 1 FROM rw_databases WHERE name = 'other_db';\nSELECT 1 FROM rw_tables WHERE name = 't' AND schema_path LIKE 'other_db%';","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Avoid dropping the upstream database while dependent cross-DB jobs are being created.","Check SHOW DATABASES before creating cross-DB backfill jobs.","After restore, verify catalog integrity before re-creating cross-DB jobs."],"tags":["barrier","backfill","cross-database","catalog","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"}