Skip to content

Commit

Permalink
fix: 定点回档支持读取已裁撤机器的备份 TencentBlueKing#7330
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo authored and iSecloud committed Oct 15, 2024
1 parent c65cbbf commit 2d76b44
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _execute(self, data, parent_data) -> bool:
response = MysqlBackupApi.download(params=params)
backup_bill_id = response.get("bill_id", -1)
if backup_bill_id > 0:
self.log_debug(_("调起下载 {}").format(backup_bill_id))
self.log_info(_("调起下载 {}").format(backup_bill_id))
data.outputs.backup_bill_id = backup_bill_id
return True
else:
Expand All @@ -70,13 +70,13 @@ def _schedule(self, data, parent_data, callback_data=None):
return True
elif result_response["total"]["fail"] > 0:
self.log_error(_("{} 下载失败").format(backup_bill_id))
self.log_debug(str(result_response))
self.log_error(str(result_response))
self.finish_schedule()
return False
else:
self.log_debug(_("{} 下载中: todo {}").format(backup_bill_id, result_response["total"]["todo"]))
self.log_info(_("{} 下载中: todo {}").format(backup_bill_id, result_response["total"]["todo"]))
else:
self.log_debug("result response fail")
self.log_error("result response fail")
self.finish_schedule()
return False

Expand Down
13 changes: 7 additions & 6 deletions dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py
Original file line number Diff line number Diff line change
Expand Up @@ -1026,11 +1026,12 @@ def get_rollback_data_restore_payload(self, **kwargs):
"""
MYSQL 定点回档恢复备份介质
"""
# if self.cluster.get("rollback_type", "") == RollbackType.LOCAL_AND_TIME:
# index_file = os.path.basename(kwargs["trans_data"]["backupinfo"]["index_file"])
# elif self.cluster.get("rollback_type", "") == RollbackType.LOCAL_AND_BACKUPID:
# index_file = os.path.basename(self.cluster["backupinfo"]["index_file"])
# else:
# if (
# self.ticket_data["ticket_type"] == TicketType.TENDBCLUSTER_ROLLBACK_CLUSTER
# or self.ticket_data["ticket_type"] == TicketType.MYSQL_ROLLBACK_CLUSTER
# ):
# self.cluster["master_ip"] = ""
# self.cluster["master_port"] = 0
index_file = os.path.basename(self.cluster["backupinfo"]["index"]["file_name"])
payload = {
"db_type": DBActuatorTypeEnum.MySQL.value,
Expand Down Expand Up @@ -1059,7 +1060,7 @@ def get_rollback_data_restore_payload(self, **kwargs):
"ignore_tables": self.cluster["tables_ignore"],
"recover_binlog": self.cluster["recover_binlog"],
},
"src_instance": {"host": self.cluster["master_ip"], "port": self.cluster["master_port"]},
"src_instance": {"host": "", "port": 0},
"change_master": self.cluster["change_master"],
"work_id": "",
},
Expand Down

0 comments on commit 2d76b44

Please sign in to comment.