From 972c3771636ddc304c3ed45bb0fcd1d6b8eaeb6e Mon Sep 17 00:00:00 2001 From: yksitu <1297650644@qq.com> Date: Wed, 26 Jun 2024 12:34:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dspider=5Fmaster?= =?UTF-8?q?=E6=97=B6=E5=87=BA=E7=8E=B0=E5=BC=82=E5=B8=B8=20#5172?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../flow/engine/bamboo/scene/spider/common/common_sub_flow.py | 3 ++- .../flow/engine/bamboo/scene/spider/spider_reduce_nodes.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py index dc71221605..905fd5e42f 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/common/common_sub_flow.py @@ -719,7 +719,8 @@ def reduce_ctls_routing(root_id: str, parent_global_data: dict, cluster: Cluster ), } ) - sub_pipeline.add_parallel_acts(acts_list=acts_list) + if len(acts_list) > 0: + sub_pipeline.add_parallel_acts(acts_list=acts_list) return sub_pipeline.build_sub_process(sub_name=_("删除中控的路由节点")) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py index fc352c1e20..a7529604ae 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/spider/spider_reduce_nodes.py @@ -87,7 +87,7 @@ def __calc_reduce_spiders( # 选择上尽量避开ctl_primary的选择, 避免做一次切换逻辑 reduce_spiders = cluster.proxyinstance_set.filter( tendbclusterspiderext__spider_role=reduce_spider_role - ).exclude(machine__ip=ctl_primary.split(":"[0]))[: spiders_count - spider_reduced_to_count] + ).exclude(machine__ip=ctl_primary.split(":")[0])[: spiders_count - spider_reduced_to_count] return [{"ip": s.machine.ip} for s in reduce_spiders]