{"record":{"id":"852589a261c8fea5","repo":"risingwavelabs/risingwave","slug":"missing-source-id-in-source-fragment","errorCode":null,"errorMessage":"missing source id in source fragment {}","messagePattern":"missing source id in source fragment (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/controller/scale.rs","lineNumber":1009,"sourceCode":"            }\n            mask.contains(FragmentTypeFlag::Source) && !mask.contains(FragmentTypeFlag::Dml)\n        });\n\n        let actor_template = EnsembleActorTemplate::render_new(\n            job,\n            worker_map,\n            entry_fragment_parallelism,\n            database_resource_group,\n            distribution_type,\n            vnode_count,\n        )?;\n\n        let source_splits = match source_entry_fragment {\n            Some(entry_fragment) => {\n                let source_id = fragment_source_ids\n                    .get(&entry_fragment.fragment_id)\n                    .ok_or_else(|| {\n                        anyhow!(\n                            \"missing source id in source fragment {}\",\n                            entry_fragment.fragment_id\n                        )\n                    })?;\n\n                let entry_fragment_id = entry_fragment.fragment_id;\n\n                let splits = fragment_splits_map\n                    .get(&entry_fragment_id)\n                    .cloned()\n                    .unwrap_or_default();\n\n                let splits: std::collections::BTreeMap<_, _> =\n                    splits.into_iter().map(|s| (s.id(), s)).collect();\n                let splits = actor_template.assign_splits(entry_fragment_id, splits);\n                Some((splits, *source_id))\n            }\n            None => None,","sourceCodeStart":991,"sourceCodeEnd":1027,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/controller/scale.rs#L991-L1027","documentation":"When the ensemble has a source entry fragment, render_actors_with_allocator requires a source ID recorded in fragment_source_ids for that fragment (needed to attach source splits to the rendered actors). If the mapping is missing, this error names the fragment ID.","triggerScenarios":"An ensemble includes a source entry fragment but the load stage did not populate fragment_source_ids for it — e.g. the fragment is classified as a source fragment yet has no corresponding source row, or the fragment-to-source mapping was lost in the catalog.","commonSituations":"Dropped/modified source connectors while fragment rows persist; jobs whose source fragments were rebuilt by an interrupted replace; version skew where older fragments lack source mapping metadata.","solutions":["Check the catalog's source-fragment mapping for the reported fragment_id and restore/repair the mapping if the source still exists.","Exclude the stale source fragment or re-create the source so the mapping is regenerated.","Reload the context freshly after any DDL completes.","Report a bug if the mapping is missing with no history of source DDL."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for frag in source_entry_fragments {\n    assert!(ctx.fragment_source_ids.contains_key(&frag.fragment_id),\n            \"source fragment {} lacks source id\", frag.fragment_id);\n}","typeGuard":"fn has_source_mapping(ctx: &LoadedFragmentContext, frag_id: FragmentId) -> bool {\n    ctx.fragment_source_ids.contains_key(&frag_id)\n}","tryCatchPattern":"let Some(source_id) = ctx.fragment_source_ids.get(&entry_fragment.fragment_id) else {\n    warn!(\"source fragment {} has no source mapping; skipping source splits\", entry_fragment.fragment_id);\n    return render_without_source_splits();\n};","preventionTips":["Never drop a source row while its fragment remains","Regenerate fragment-to-source mappings after connector DDL","Reload context after any source ALTER/DROP","Check mapping completeness for source fragments before rescale"],"tags":["rescale","source","fragment","allocator"],"backgroundTag":"missing-required-argument","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T21:17:11.552Z"}