Skip to content

Commit

Permalink
fix: mysql扩容单据元数据标志位处理 TencentBlueKing#8493
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo committed Dec 10, 2024
1 parent b7afb6b commit d0d7e4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ def switch_remote_node(cls, cluster_id: int, source: dict, target: dict):
source_master_obj.status = InstanceStatus.UNAVAILABLE
source_master_obj.phase = InstancePhase.OFFLINE
source_master_obj.is_stand_by = False
# 新主节点删除tuple关系
StorageInstanceTuple.objects.filter(ejector=source_master_obj, receiver=target_master_obj).delete()
# 移出集群
cluster.storageinstance_set.remove(source_master_obj)
if source_slave_obj.ip_port != target_slave_obj.ip_port:
Expand Down
2 changes: 2 additions & 0 deletions dbm-ui/backend/db_meta/api/cluster/tendbha/switch_slave.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def switch_slave(cluster_id: int, target_slave_ip: str, source_slave_ip: str, sl
source_storage_obj.phase = InstancePhase.OFFLINE.value
source_storage_obj.is_stand_by = False
source_storage_obj.save()
# 移除关系
cluster.storageinstance_set.remove(source_storage_obj)
cluster_entry_list = cluster.clusterentry_set.filter(entry__in=slave_domain)
for cluster_entry in cluster_entry_list:
cluster_entry.storageinstance_set.remove(source_storage_obj)
Expand Down

0 comments on commit d0d7e4e

Please sign in to comment.