From 8f0196e3ef98a4369ed018cc64b92fe2a70d7f4b Mon Sep 17 00:00:00 2001 From: xfwduke Date: Fri, 13 Dec 2024 17:45:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(mysql):=20=E4=BF=AE=E5=A4=8Ddbha=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3index=20range=20#8614?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dbm-ui/backend/db_meta/flatten/storage_instance.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dbm-ui/backend/db_meta/flatten/storage_instance.py b/dbm-ui/backend/db_meta/flatten/storage_instance.py index 47337261c2..0a5446135e 100644 --- a/dbm-ui/backend/db_meta/flatten/storage_instance.py +++ b/dbm-ui/backend/db_meta/flatten/storage_instance.py @@ -70,8 +70,12 @@ def storage_instance(storages: QuerySet) -> List[Dict]: receiver = [] for tp in ins.as_ejector.all(): + ejector_clusters = list(tp.ejector.cluster.all()) + receiver_clusters = list(tp.receiver.cluster.all()) if ( - tp.ejector.cluster.all()[0].id == tp.receiver.cluster.all()[0].id + len(ejector_clusters) > 0 + and len(receiver_clusters) > 0 + and ejector_clusters[0].id == receiver_clusters[0].id and tp.receiver.status == InstanceStatus.RUNNING and tp.receiver.instance_inner_role == InstanceInnerRole.SLAVE and tp.receiver.phase == InstancePhase.ONLINE @@ -88,8 +92,12 @@ def storage_instance(storages: QuerySet) -> List[Dict]: ejector = [] for tp in ins.as_receiver.all(): + ejector_clusters = list(tp.ejector.cluster.all()) + receiver_clusters = list(tp.receiver.cluster.all()) if ( - tp.ejector.cluster.all()[0].id == tp.receiver.cluster.all()[0].id + len(ejector_clusters) > 0 + and len(receiver_clusters) > 0 + and ejector_clusters[0].id == receiver_clusters[0].id and tp.ejector.status == InstanceStatus.RUNNING and tp.ejector.instance_inner_role in [InstanceInnerRole.MASTER, InstanceInnerRole.REPEATER] and tp.ejector.phase == InstancePhase.ONLINE