risingwavelabs/risingwave · error
no actors to assign; assignment is meaningless
Error message
no actors to assign; assignment is meaningless
What it means
Same guard family as the worker check: `ensure!` in the inner `assign_hierarchical` (assignment.rs:753) refuses to run when the actor list is empty, because a scheduling decision over zero actors has no meaning.
Source
Thrown at src/meta/src/stream/stream_graph/assignment.rs:753
}
/// Hierarchical assignment: Actors → Workers → `VNodes` → Actors.
pub fn assign_hierarchical<W, A, V>(
&self,
workers: &BTreeMap<W, NonZeroUsize>,
actors: &[A],
vnodes: &[V],
) -> Result<BTreeMap<W, BTreeMap<A, Vec<V>>>>
where
W: Ord + Hash + Eq + Clone + Debug,
A: Ord + Hash + Eq + Copy + Debug,
V: Hash + Eq + Copy + Debug,
{
ensure!(
!workers.is_empty(),
"no workers to assign; assignment is meaningless"
);
ensure!(
!actors.is_empty(),
"no actors to assign; assignment is meaningless"
);
ensure!(
!vnodes.is_empty(),
"no vnodes to assign; assignment is meaningless"
);
ensure!(
vnodes.len() >= actors.len(),
"not enough vnodes ({}) for actors ({}); each actor needs at least one vnode",
vnodes.len(),
actors.len()
);
let chunk_size = match self.vnode_chunking_strategy {
VnodeChunkingStrategy::NoChunking => {
return assign_hierarchical(
workers,View on GitHub (pinned to 6469eb736d)
Solutions
- Ensure actors are generated (parallelism >= 1) for every fragment before assignment.
- Add an earlier caller-side check with a fragment-id-bearing error message.
- Investigate plan generation if a valid fragment ends up with zero actors.
Example fix
// before
let plan = assign_hierarchical(&workers, &[], &vnodes, strategy)?;
// after
if actors.is_empty() {
return Err(anyhow!("fragment {} generated no actors", fragment_id));
}
let plan = assign_hierarchical(&workers, &actors, &vnodes, strategy)?; Defensive patterns
Strategy: validation
Validate before calling
// Rust, before scheduling
if actors.is_empty() {
anyhow::bail!("fragment produced no actors");
} Type guard
fn non_empty_actors<'a>(a: &'a [ActorId]) -> Option<&'a [ActorId]> {
(!a.is_empty()).then_some(a)
} Try / catch
match assign_hierarchical(&workers, &actors, &vnodes, strategy) {
Ok(m) => m,
Err(e) if e.to_string().contains("no actors") => {
Err(anyhow!("plan generation bug: zero actors: {e:#}"))
}
Err(e) => Err(e),
} Prevention
- Assert non-empty actor sets in planner/fragment tests.
- Treat zero-actor fragments as plan-generation bugs, not runtime conditions.
- Include fragment id in caller-side errors for faster triage.
When it happens
Trigger: Calling the inner assignment routine with `actors.is_empty()`; mirrors the public entry's earlier check but in the ensure! chain.
Common situations: Fragments that produced no actors due to plan generation bugs; direct API/test usage with empty actor vectors.
Understand the failure class
Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.
Related errors
- no actors to assign
- no vnodes to assign
- actor count ({}) exceeds vnode count ({})
- no workers to assign; assignment is meaningless
- no vnodes to assign; assignment is meaningless
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/50482ede5dd68743.
Report an issue: GitHub.