From f60be139715b8b54e1e2c8d5d9ac8431de29395b Mon Sep 17 00:00:00 2001 From: zwang28 <70626450+zwang28@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:20:13 +0800 Subject: [PATCH] fix(meta): correctly update serving vnode mapping after scaling (#18349) --- src/meta/src/manager/metadata.rs | 10 ++++++++++ src/meta/src/stream/scale.rs | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/meta/src/manager/metadata.rs b/src/meta/src/manager/metadata.rs index a639a77f73bfa..52fc811787d30 100644 --- a/src/meta/src/manager/metadata.rs +++ b/src/meta/src/manager/metadata.rs @@ -356,6 +356,16 @@ impl MetadataManager { } } + pub async fn list_active_serving_compute_nodes(&self) -> MetaResult> { + match self { + MetadataManager::V1(mgr) => Ok(mgr + .cluster_manager + .list_active_serving_compute_nodes() + .await), + MetadataManager::V2(mgr) => mgr.cluster_controller.list_active_serving_workers().await, + } + } + pub async fn list_background_creating_jobs(&self) -> MetaResult> { match self { MetadataManager::V1(mgr) => { diff --git a/src/meta/src/stream/scale.rs b/src/meta/src/stream/scale.rs index 634cca76f0d7e..d10fa83710d85 100644 --- a/src/meta/src/stream/scale.rs +++ b/src/meta/src/stream/scale.rs @@ -1745,7 +1745,7 @@ impl ScaleController { if !reschedules.is_empty() { let workers = self .metadata_manager - .list_active_streaming_compute_nodes() + .list_active_serving_compute_nodes() .await?; let streaming_parallelisms = self .metadata_manager