From 2d76b448aac3f7b3d3897eec13679cd9d895ac9e Mon Sep 17 00:00:00 2001 From: zfrendo <842557664@qq.com> Date: Mon, 14 Oct 2024 16:01:07 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AE=9A=E7=82=B9=E5=9B=9E=E6=A1=A3?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AF=BB=E5=8F=96=E5=B7=B2=E8=A3=81=E6=92=A4?= =?UTF-8?q?=E6=9C=BA=E5=99=A8=E7=9A=84=E5=A4=87=E4=BB=BD=20#7330?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../collections/mysql/mysql_download_backupfile.py | 8 ++++---- .../backend/flow/utils/mysql/mysql_act_playload.py | 13 +++++++------ 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py index ba83f9f5c6..c7a0e09743 100644 --- a/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py +++ b/dbm-ui/backend/flow/plugins/components/collections/mysql/mysql_download_backupfile.py @@ -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: @@ -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 diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py index 05ea28da28..0e73f7f40b 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py @@ -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, @@ -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": "", },