risingwavelabs/risingwave · error · MetaError

fragment not found in shared actor info

Error message

fragment {} not found in shared actor info

What it means

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.

Solutions

  1. Ensure the streaming job's actors are fully deployed/published before querying its fragment actor info
  2. Retry if a concurrent DROP/rewrite of the job may have removed the actors
  3. Cross-check fragment ids against the shared actor info cache contents in meta logs
  4. If recurring after restart, investigate shared actor info recovery completeness

Example fix

// before
let info = guard.get_fragment(fid).ok_or_else(|| anyhow!("fragment {} not found", fid))?;
// after
let Some(info) = guard.get_fragment(fid) else {
    return Err(MetaError::fragment_not_found(fid)); // typed, retryable error
};
Defensive patterns

Strategy: retry

Validate before calling

let in_cache = env.shared_actor_infos().read_guard().get_fragment(fragment_id).is_some();

Type guard

fn fragment_in_shared_info(guard: &SharedActorInfos, fid: FragmentId) -> bool { guard.get_fragment(fid).is_some() }

Try / catch

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) } }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/8c49e37db9b925fe. Report an issue: GitHub.

Appendix: source

Thrown at src/meta/src/controller/fragment.rs:1010

            .map(|(k, v)| (k, v.len()))
            .collect();

        Ok(actor_cnt)
    }

    fn collect_fragment_actor_map(
        &self,
        fragment_ids: &[FragmentId],
        stream_context: StreamContext,
    ) -> MetaResult<HashMap<FragmentId, Vec<ActorInfo>>> {
        let guard = self.env.shared_actor_infos().read_guard();
        let pb_expr_context = stream_context.to_expr_context();
        let expr_context: ExprContext = (&pb_expr_context).into();

        let mut actor_map = HashMap::with_capacity(fragment_ids.len());
        for fragment_id in fragment_ids {
            let fragment_info = guard.get_fragment(*fragment_id as _).ok_or_else(|| {
                anyhow!("fragment {} not found in shared actor info", fragment_id)
            })?;

            let actors = fragment_info
                .actors
                .iter()
                .map(|(actor_id, actor_info)| ActorInfo {
                    actor_id: *actor_id as _,
                    fragment_id: *fragment_id,
                    splits: ConnectorSplits::from(&PbConnectorSplits {
                        splits: actor_info.splits.iter().map(ConnectorSplit::from).collect(),
                    }),
                    worker_id: actor_info.worker_id as _,
                    vnode_bitmap: actor_info
                        .vnode_bitmap
                        .as_ref()
                        .map(|bitmap| VnodeBitmap::from(&bitmap.to_protobuf())),
                    expr_context: expr_context.clone(),
                    config_override: stream_context.config_override.clone(),

View on GitHub (pinned to 6469eb736d)