{"record":{"id":"8c49e37db9b925fe","repo":"risingwavelabs/risingwave","slug":"fragment-not-found-in-shared-actor-info","errorCode":null,"errorMessage":"fragment {} not found in shared actor info","messagePattern":"fragment (.+?) not found in shared actor info","errorType":"exception","errorClass":"MetaError","httpStatus":null,"severity":"error","filePath":"src/meta/src/controller/fragment.rs","lineNumber":1010,"sourceCode":"            .map(|(k, v)| (k, v.len()))\n            .collect();\n\n        Ok(actor_cnt)\n    }\n\n    fn collect_fragment_actor_map(\n        &self,\n        fragment_ids: &[FragmentId],\n        stream_context: StreamContext,\n    ) -> MetaResult<HashMap<FragmentId, Vec<ActorInfo>>> {\n        let guard = self.env.shared_actor_infos().read_guard();\n        let pb_expr_context = stream_context.to_expr_context();\n        let expr_context: ExprContext = (&pb_expr_context).into();\n\n        let mut actor_map = HashMap::with_capacity(fragment_ids.len());\n        for fragment_id in fragment_ids {\n            let fragment_info = guard.get_fragment(*fragment_id as _).ok_or_else(|| {\n                anyhow!(\"fragment {} not found in shared actor info\", fragment_id)\n            })?;\n\n            let actors = fragment_info\n                .actors\n                .iter()\n                .map(|(actor_id, actor_info)| ActorInfo {\n                    actor_id: *actor_id as _,\n                    fragment_id: *fragment_id,\n                    splits: ConnectorSplits::from(&PbConnectorSplits {\n                        splits: actor_info.splits.iter().map(ConnectorSplit::from).collect(),\n                    }),\n                    worker_id: actor_info.worker_id as _,\n                    vnode_bitmap: actor_info\n                        .vnode_bitmap\n                        .as_ref()\n                        .map(|bitmap| VnodeBitmap::from(&bitmap.to_protobuf())),\n                    expr_context: expr_context.clone(),\n                    config_override: stream_context.config_override.clone(),","sourceCodeStart":992,"sourceCodeEnd":1028,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/controller/fragment.rs#L992-L1028","documentation":"collect_fragment_actor_map resolves each requested fragment id in the in-memory shared actor info snapshot; if a fragment is absent from that map it returns 'fragment {} not found in shared actor info'. The live actor distribution cache does not contain the fragment, so actor info cannot be assembled for the API response.","triggerScenarios":"Calling collect_fragment_actor_pairs (via get_job_fragments_by_id or table_fragments) for fragment ids that exist in the DB but are not (yet/no longer) present in the shared actor info snapshot.","commonSituations":"Fetching fragments while a job is being dropped and its actors evicted from shared actor info; querying fragments before actor deployment finished; meta recovery with incomplete shared actor info replay.","solutions":["Ensure the streaming job's actors are fully deployed/published before querying its fragment actor info","Retry if a concurrent DROP/rewrite of the job may have removed the actors","Cross-check fragment ids against the shared actor info cache contents in meta logs","If recurring after restart, investigate shared actor info recovery completeness"],"exampleFix":"// before\nlet info = guard.get_fragment(fid).ok_or_else(|| anyhow!(\"fragment {} not found\", fid))?;\n// after\nlet Some(info) = guard.get_fragment(fid) else {\n    return Err(MetaError::fragment_not_found(fid)); // typed, retryable error\n};","handlingStrategy":"retry","validationCode":"let in_cache = env.shared_actor_infos().read_guard().get_fragment(fragment_id).is_some();","typeGuard":"fn fragment_in_shared_info(guard: &SharedActorInfos, fid: FragmentId) -> bool { guard.get_fragment(fid).is_some() }","tryCatchPattern":"loop { match get_job_fragments_by_id(id).await { Ok(v) => break Ok(v), Err(e) if is_missing_fragment(&e) => sleep(BACKOFF).await, Err(e) => break Err(e) } }","preventionTips":["Only query fragments after job creation fully completes","Retry with backoff when drop/rewrite DDL may be running","Monitor shared actor info size after meta recovery"],"tags":["cache-miss","fragment","actor","not-found"],"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"}