Skip to content

Commit

Permalink
fix(mysql): 修复dbha接口index range #8614
Browse files Browse the repository at this point in the history
  • Loading branch information
xfwduke authored and iSecloud committed Dec 13, 2024
1 parent f964e3f commit 8f0196e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions dbm-ui/backend/db_meta/flatten/storage_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8f0196e

Please sign in to comment.