From 0f1984a58cdb318158c707723057eeded71bcc09 Mon Sep 17 00:00:00 2001 From: Shanicky Chen Date: Wed, 18 Sep 2024 22:13:55 +0800 Subject: [PATCH] chore(scale): Report an error instead of asserting for unsatisfied conditions in the plan. (#18589) Signed-off-by: Shanicky Chen --- src/meta/src/stream/scale.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/meta/src/stream/scale.rs b/src/meta/src/stream/scale.rs index 1cefc9350b93..3c73b947d830 100644 --- a/src/meta/src/stream/scale.rs +++ b/src/meta/src/stream/scale.rs @@ -1603,7 +1603,9 @@ impl ScaleController { for (worker_id, n) in decreased_actor_count { if let Some(actor_ids) = worker_to_actors.get(worker_id) { - assert!(actor_ids.len() >= n); + if actor_ids.len() < n { + bail!("plan illegal, for fragment {}, worker {} only has {} actors, but needs to reduce {}",fragment_id, worker_id, actor_ids.len(), n); + } let removed_actors: Vec<_> = actor_ids .iter()