{"record":{"id":"c55355a91b5b8ce6","repo":"risingwavelabs/risingwave","slug":"expect-at-least-1-actor-0-was-found","errorCode":null,"errorMessage":"Expect at least 1 actor, 0 was found.","messagePattern":"Expect at least 1 actor, 0 was found\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/stream/cdc.rs","lineNumber":195,"sourceCode":"        is_parallelized_backfill_enabled_cdc_scan_fragment(f.fragment_type_mask, &f.nodes)\n            .map(|cdc_scan| (f, cdc_scan))\n    });\n    let fragment = stream_scan_fragments.next()?;\n    assert_eq!(\n        stream_scan_fragments.count(),\n        0,\n        \"Expect no remaining scan fragment\",\n    );\n    Some(fragment)\n}\n\npub(crate) fn assign_cdc_table_snapshot_splits(\n    actor_ids: HashSet<ActorId>,\n    splits: &[CdcTableSnapshotSplitRaw],\n    generation: u64,\n) -> MetaResult<HashMap<ActorId, PbCdcTableSnapshotSplits>> {\n    if actor_ids.is_empty() {\n        return Err(anyhow::anyhow!(\"Expect at least 1 actor, 0 was found.\").into());\n    }\n    if splits.is_empty() {\n        return Err(\n            anyhow::anyhow!(\"Expect at least 1 CDC table snapshot splits, 0 was found.\").into(),\n        );\n    }\n    let splits_per_actor = splits.len().div_ceil(actor_ids.len());\n    let mut assignments = HashMap::new();\n    for (actor_id, splits) in actor_ids.iter().copied().zip_eq_debug(\n        splits\n            .iter()\n            .map(build_cdc_table_snapshot_split)\n            .chunks(splits_per_actor)\n            .into_iter()\n            .map(|c| c.collect_vec())\n            .chain(iter::repeat(Vec::default()))\n            .take(actor_ids.len()),\n    ) {","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/stream/cdc.rs#L177-L213","documentation":"assign_cdc_table_snapshot_splits distributes CDC table snapshot splits across a set of actors. It refuses to proceed when the actor set is empty, because there is nowhere to assign splits. reassign_splits raises this when the meta node computed no eligible actors for a CDC table backfill.","triggerScenarios":"reassign_splits calls assign_cdc_table_snapshot_splits with an empty actor_ids HashSet — e.g. all actors for the CDC table were removed, the streaming job has no running actors, or actor filtering (by state/host) eliminated every candidate during recovery or scale-in.","commonSituations":"Rescheduling after a worker node failure where no replacement actor was created yet; interrupting a CDC backfill mid-flight; recovering a CDC job whose fragments were already dropped in meta.","solutions":["Check the CDC streaming job status (SHOW JOBS / job state); if it was dropped or finishing, this is a benign race — retry or ignore.","Ensure worker nodes are healthy so actors can be scheduled before splits are reassigned (check compute node liveness and actor counts).","Retry the operation; reassign_splits is typically triggered again by the scheduler once actors exist.","If persistent, restart the affected compute node or recreate the CDC table backfill."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let actors: Vec<_> = job.actors.values().filter(|a| a.is_running()).collect();\nif actors.is_empty() {\n    // skip snapshot reassignment until actors exist\n    return Ok(());\n}","typeGuard":null,"tryCatchPattern":"match reassign_splits(job_id).await {\n    Err(e) if e.to_string().contains(\"Expect at least 1 actor\") => {\n        // benign: job likely dropped or finishing; log and skip\n        tracing::debug!(%job_id, \"no actors for cdc snapshot reassignment\");\n    }\n    other => other?,\n}","preventionTips":["Keep enough healthy compute nodes so CDC backfill actors can always be scheduled.","Check job state (dropped/finishing) before requesting snapshot reassignment.","Retry reassignment after worker recovery instead of failing the whole job."],"tags":["cdc","scheduling","actors","backfill"],"backgroundTag":"empty-required-field","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}