{"record":{"id":"745c94194ac0e5a9","repo":"risingwavelabs/risingwave","slug":"failed-to-retrieve-fragment-description-fragment","errorCode":null,"errorMessage":"Failed to retrieve fragment description: fragment {} (job_id {}) not found in shared actor info","messagePattern":"Failed to retrieve fragment description: fragment (.+?) \\(job_id (.+?)\\) not found in shared actor info","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"src/meta/src/controller/fragment.rs","lineNumber":582,"sourceCode":"\n        let upstreams: Vec<_> = upstream_entries\n            .into_iter()\n            .map(|(source_id, _)| source_id)\n            .collect();\n\n        let root_fragment_map = find_fragment_no_shuffle_dags_detailed(&inner.db, &[fragment_id])\n            .await\n            .map(Self::collect_root_fragment_mapping)?;\n        let root_fragments = root_fragment_map\n            .get(&fragment_id)\n            .cloned()\n            .unwrap_or_default();\n\n        let info = self.env.shared_actor_infos().read_guard();\n        let SharedFragmentInfo { actors, .. } = info\n            .get_fragment(fragment_model.fragment_id as _)\n            .unwrap_or_else(|| {\n                panic!(\n                    \"Failed to retrieve fragment description: fragment {} (job_id {}) not found in shared actor info\",\n                    fragment_model.fragment_id,\n                    fragment_model.job_id\n                )\n            });\n\n        let parallelism_policy = Self::format_fragment_parallelism_policy(\n            fragment_model.distribution_type,\n            fragment_model.parallelism.as_ref(),\n            job_parallelism.as_ref().map(|(parallelism, _)| parallelism),\n            job_parallelism\n                .as_ref()\n                .and_then(|(_, strategy)| strategy.as_deref()),\n            &root_fragments,\n        );\n\n        let fragment = FragmentDesc {\n            fragment_id: fragment_model.fragment_id,","sourceCodeStart":564,"sourceCodeEnd":600,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/controller/fragment.rs#L564-L600","documentation":"get_fragment_desc_by_id reads the fragment row from the database, then looks up the live fragment/actor info in the in-memory shared actor info cache. The error (a panic via unwrap_or_else) means the DB still has the fragment but the shared-actor-info snapshot no longer holds it, i.e. cache and database are out of sync.","triggerScenarios":"Calling FragmentManager::get_fragment_desc_by_id for a fragment_id whose fragment exists in the fragments table but was evicted/never inserted into shared actor info — e.g. querying during job deletion, or before the job's actors were published to the cache.","commonSituations":"Frontend fetching fragment descriptions while a DDL (drop/backfill cancel) is concurrently removing the job's actors; querying right after meta recovery when shared actor info was rebuilt from incomplete data; debugging tools hitting fragments of already-dropped streaming jobs.","solutions":["Verify the streaming job still exists (not being dropped) before querying its fragments","Retry after a short delay if a concurrent DDL may be in flight","Inspect meta node logs for shared actor info eviction/rebuild events around the failure time","If reproducible after restart, check that actor deployment completion persists shared fragment info before responding to the DDL"],"exampleFix":"// before\nlet info = shared_actor_infos().read_guard().get_fragment(fid).unwrap_or_else(|| panic!(...));\n// after\nlet info = shared_actor_infos().read_guard().get_fragment(fid).ok_or_else(|| MetaError::fragment_not_found(fid))?;","handlingStrategy":"try-catch","validationCode":"// caller: check job still exists before fetching fragments\nlet exists = StreamingJob::find_by_id(job_id).one(&db).await?.is_some();","typeGuard":"fn fragment_in_shared_info(guard: &SharedActorInfos, fid: FragmentId) -> bool { guard.get_fragment(fid).is_some() }","tryCatchPattern":"match get_fragment_desc_by_id(job_id).await { Ok(d) => d, Err(e) if e.to_string().contains(\"not found in shared actor info\") => retry_or_skip(job_id), Err(e) => return Err(e) }","preventionTips":["Avoid querying fragments while DROP DDL on the job is in flight","Retry with backoff on transient races","Verify shared actor info recovery completeness after meta restarts"],"tags":["cache-miss","fragment","panic","meta"],"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"}