Skip to content

Commit

Permalink
feat: tendbCluster定点回档增加中控节点的回档 TencentBlueKing#7352
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo committed Oct 21, 2024
1 parent 85ca534 commit 8539064
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions dbm-ui/backend/flow/utils/spider/tendb_cluster_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"""
import copy

from backend.constants import IP_PORT_DIVIDER
from backend.db_meta.models import Cluster, StorageInstance


Expand Down Expand Up @@ -45,18 +46,12 @@ def get_rollback_clusters_info(
source_spiders = source_obj.proxyinstance_set.filter()
target_spiders = target_obj.proxyinstance_set.filter()
primary_map = Cluster.get_cluster_id__primary_address_map([source_obj.id, target_obj.id])

for spider in source_spiders:
spider_info = spider.simple_desc
if spider_info["instance"] == primary_map[source_obj.id]:
spider_info["is_admin"] = True
else:
spider_info["is_admin"] = False
cluster_info["source_spiders"].append(spider_info)
cluster_info["source_spiders"].append(spider.simple_desc)

for spider in target_spiders:
spider_info = spider.simple_desc
if spider_info["instance"] == primary_map[target_obj.id]:
if f'{spider_info["ip"]}{IP_PORT_DIVIDER}{spider_info["admin_port"]}' == primary_map[target_obj.id]:
spider_info["is_admin"] = True
else:
spider_info["is_admin"] = False
Expand Down

0 comments on commit 8539064

Please sign in to comment.