risingwavelabs/risingwave · error

database of cross db upstream table {} not found

Error message

database of cross db upstream table {} not found

What it means

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.

Source

Thrown at src/meta/src/barrier/checkpoint/control.rs:278

                        if let Some(database) = database.running_state()
                            && database.database_info.contains_job(table_id.as_job_id())
                        {
                            if let Some(committed_epoch) = database.committed_epoch {
                                *snapshot_epoch = Some(committed_epoch);
                            }
                            break;
                        }
                    }
                    if snapshot_epoch.is_none() {
                        let table_id = *table_id;
                        warn!(
                            ?cross_db_snapshot_backfill_info,
                            ?table_id,
                            ?info,
                            "database of cross db upstream table not found"
                        );
                        let err: MetaError =
                            anyhow!("database of cross db upstream table {} not found", table_id)
                                .into();
                        notifier.notify_start_failed(err);

                        return Ok(());
                    }
                }
            }

            let database = match self.databases.entry(database_id) {
                Entry::Occupied(entry) => entry
                    .into_mut()
                    .expect_running("should not have command when not running"),
                Entry::Vacant(entry) => match &command {
                    Command::CreateStreamingJob { info, job_type, .. } => {
                        let CreateStreamingJobType::Normal = job_type else {
                            if cfg!(debug_assertions) {
                                panic!(
                                    "unexpected first job of type {job_type:?} with info {info:?}"

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Verify the upstream database still exists (SHOW DATABASES) and recreate it if it was dropped.
  2. Re-create the streaming job after confirming the upstream table/database exists.
  3. If occurring after restore, verify catalog integrity of the restored metadata.

Example fix

-- before: upstream db dropped mid-creation
CREATE MATERIALIZED VIEW mv AS SELECT * FROM other_db.t;
-- after: ensure db exists first
CREATE DATABASE IF NOT EXISTS other_db;
CREATE MATERIALIZED VIEW mv AS SELECT * FROM other_db.t;
Defensive patterns

Strategy: validation

Validate before calling

-- confirm upstream db/table exist before cross-db backfill DDL
SELECT 1 FROM rw_databases WHERE name = 'other_db';
SELECT 1 FROM rw_tables WHERE name = 't' AND schema_path LIKE 'other_db%';

Prevention

When it happens

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

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

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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