{"record":{"id":"3046ab48bd5b391a","repo":"risingwavelabs/risingwave","slug":"downstream-relation-missing-for","errorCode":null,"errorMessage":"downstream relation missing for {} -> {}","messagePattern":"downstream relation missing for (.+?) -> (.+?)","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/stream/scale.rs","lineNumber":930,"sourceCode":"                            .collect(),\n                    };\n\n                let target_fragment_distribution = *distribution_type;\n\n                let fragment_relation::Model {\n                    source_fragment_id: _,\n                    target_fragment_id: _,\n                    dispatcher_type,\n                    dist_key_indices,\n                    output_indices,\n                    output_type_mapping,\n                } = downstream_relations\n                    .remove(&(\n                        *fragment_id as FragmentId,\n                        *downstream_fragment_id as FragmentId,\n                    ))\n                    .ok_or_else(|| {\n                        MetaError::from(anyhow!(\n                            \"downstream relation missing for {} -> {}\",\n                            fragment_id,\n                            downstream_fragment_id\n                        ))\n                    })?;\n\n                let pb_mapping = PbDispatchOutputMapping {\n                    indices: output_indices.into_u32_array(),\n                    types: output_type_mapping.unwrap_or_default().to_protobuf(),\n                };\n\n                let (dispatchers, _) = compose_dispatchers(\n                    *distribution_type,\n                    &source_fragment_actors,\n                    *downstream_fragment_id,\n                    target_fragment_distribution,\n                    &target_fragment_actors,\n                    dispatcher_type,","sourceCodeStart":912,"sourceCodeEnd":948,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/stream/scale.rs#L912-L948","documentation":"Thrown by build_reschedule_commands during rescale when a downstream relation entry expected in the `downstream_relations` map is absent for a (fragment_id, downstream_fragment_id) pair. The map is built from the previous fragment graph, so its absence means the plan was not assembled with all upstream->downstream edges intact. It is an internal consistency check in the scale (parallelism/rewrite) path.","triggerScenarios":"Rescale (ALTER ... SET PARALLELISM / pause-resume migration) where a downstream fragment lookup key is missing because the edge was already removed by an earlier iteration, or the reschedule context omitted the edge.","commonSituations":"Running rescale on a streaming job whose fragment graph changed concurrently (another DDL in flight), or a meta-service bug/state corruption after partial migration.","solutions":["Retry the rescale operation once other DDL on the job has settled","Check meta logs for concurrent DDL on the same table/mv during rescale","Verify the job's fragment graph is intact via RW_FRAGMENT_STATS / meta node metadata","Upgrade to a version with the fix if this reproduces deterministically"],"exampleFix":"// No caller-side code fix; retry rescale after no other DDL is running\n// before: ALTER TABLE t SET PARALLELISM 4;  (while CREATE MV on t is running)\n// after:  wait for CREATE MV to finish, then ALTER TABLE t SET PARALLELISM 4;","handlingStrategy":"retry","validationCode":"-- before rescaling, ensure no other DDL is running on the job\nSELECT * FROM rw_catalog.rw_ddl_progress WHERE table_name = 'my_mv';","typeGuard":null,"tryCatchPattern":"match rescale_result {\n    Err(e) if e.to_string().contains(\"downstream relation missing\") => {\n        // wait for concurrent DDL, then retry rescale\n    }\n    r => r?,\n}","preventionTips":["Avoid concurrent DDL on a job while rescaling","Check rw_ddl_progress before issuing ALTER ... SET PARALLELISM","Retry rescale with backoff on transient meta errors"],"tags":["rust","meta","scaling","streaming"],"backgroundTag":"internal-invariant-violation","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"}