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 ef4e0d3 commit 0f27f96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def tendb_rollback_data(self):
for spider_node in clusters_info["target_spiders"]:
if "spider_node" not in backup_info:
raise TendbGetBackupInfoFailedException(message=_("获取spider节点备份信息不存在"))
if backup_info["spider_node"] == "":
if backup_info["spider_node"] == "" or len(backup_info["spider_node"]) == 0:
raise TendbGetBackupInfoFailedException(message=_("获取spider节点备份信息为空"))
if not check_storage_database(target_cluster.bk_cloud_id, spider_node["ip"], spider_node["port"]):
logger.error("cluster {} check database fail".format(target_cluster.id))
Expand Down Expand Up @@ -210,7 +210,7 @@ def tendb_rollback_data(self):
if spider_node["is_admin"]:
if "tdbctl_node" not in backup_info:
raise TendbGetBackupInfoFailedException(message=_("获取中控节点备份信息不存在"))
if backup_info["tdbctl_node"] == "":
if backup_info["tdbctl_node"] == "" or len(backup_info["tdbctl_node"]) == 0:
raise TendbGetBackupInfoFailedException(message=_("获取中控节点备份信息为空"))
ctl_sub_pipeline = SubBuilder(root_id=self.root_id, data=copy.deepcopy(self.data))
ctl_cluster = copy.deepcopy(spd_cluster)
Expand Down
4 changes: 3 additions & 1 deletion dbm-ui/backend/flow/utils/mysql/mysql_db_meta.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,9 @@ def slave_recover_del_instance(self):
cluster = Cluster.objects.get(id=cluster_id)
master = cluster.main_storage_instances()[0]
old_slave = StorageInstance.objects.get(
machine__ip=self.cluster["uninstall_ip"], port=master.port, machine__bk_cloud_id=cluster.bk_cloud_id
machine__ip=self.cluster["uninstall_ip"],
port=master.port,
machine__bk_cloud_id=cluster.bk_cloud_id,
)
api.cluster.tendbha.remove_storage_tuple(
master_ip=master.machine.ip,
Expand Down

0 comments on commit 0f27f96

Please sign in to comment.