{"record":{"id":"1d556d3f446a70ca","repo":"risingwavelabs/risingwave","slug":"upstream-table-id-not-covered","errorCode":null,"errorMessage":"upstream table id not covered: {}","messagePattern":"upstream table id not covered: (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/stream/stream_graph/fragment.rs","lineNumber":1622,"sourceCode":"    let mut applied = false;\n    visit_stream_node_cont_mut(node, |node| {\n        if let Some(NodeBody::StreamScan(stream_scan)) = node.node_body.as_mut()\n            && (stream_scan.stream_scan_type == StreamScanType::SnapshotBackfill as i32\n                || stream_scan.stream_scan_type == StreamScanType::CrossDbSnapshotBackfill as i32)\n        {\n            result = try {\n                let table_id = stream_scan.table_id;\n                let snapshot_epoch = cross_db_snapshot_backfill_info\n                    .upstream_mv_table_id_to_backfill_epoch\n                    .get(&table_id)\n                    .or_else(|| {\n                        snapshot_backfill_info.and_then(|snapshot_backfill_info| {\n                            snapshot_backfill_info\n                                .upstream_mv_table_id_to_backfill_epoch\n                                .get(&table_id)\n                        })\n                    })\n                    .ok_or_else(|| anyhow!(\"upstream table id not covered: {}\", table_id))?\n                    .ok_or_else(|| anyhow!(\"upstream table id not set: {}\", table_id))?;\n                if let Some(prev_snapshot_epoch) =\n                    stream_scan.snapshot_backfill_epoch.replace(snapshot_epoch)\n                {\n                    Err(anyhow!(\n                        \"snapshot backfill epoch set again: {} {} {}\",\n                        table_id,\n                        prev_snapshot_epoch,\n                        snapshot_epoch\n                    ))?;\n                }\n                applied = true;\n            };\n            result.is_ok()\n        } else {\n            true\n        }\n    });","sourceCodeStart":1604,"sourceCodeEnd":1640,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/stream/stream_graph/fragment.rs#L1604-L1640","documentation":"`fill_snapshot_backfill_epoch` looks up each snapshot-backfill StreamScan's table id in the collected SnapshotBackfillInfo maps (cross-db first, then regular). If the table id appears in neither map, the scan cannot receive a backfill epoch and the function errors, since leaving the epoch unset would produce an invalid graph.","triggerScenarios":"Filling epochs during replace/refresh where a StreamScan node's table_id is missing from both `cross_db_snapshot_backfill_info` and `snapshot_backfill_info.upstream_mv_table_id_to_backfill_epoch` — e.g. the collect step skipped a fragment or the upstream relation changed id.","commonSituations":"Schema change or MV refresh where upstream MV topology changed between collect and fill; cross-database scans referencing MVs not registered in the info map; bugs in fragment collection.","solutions":["Ensure collect_snapshot_backfill_info_impl ran over all fragments containing the scan (fragment_type_mask includes the scan fragments).","Verify the upstream MV's table id didn't change (e.g. after replace) and that maps were built with the same ids.","Recreate the MV chain if the topology was mutated mid-flight, then retry."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"// Check coverage before filling:\nif !info.upstream_mv_table_id_to_backfill_epoch.contains_key(&table_id) {\n    // skip or collect first\n}","preventionTips":["Always run collect_snapshot_backfill_info_impl over the full fragment set before fill.","Verify table ids are stable across collect/fill phases (no concurrent replaces).","Log the collected map contents when debugging backfill epoch failures."],"tags":["meta-service","snapshot-backfill","streaming-graph","lookup-failed"],"backgroundTag":"record-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"}