From 42fb85cf8546e33bb0b24eeed943953b49855b34 Mon Sep 17 00:00:00 2001 From: yuanruji Date: Thu, 26 Sep 2024 10:41:39 +0800 Subject: [PATCH] fix 123 --- .../scene/mysql/mysql_non_standby_slaves_upgrade.py | 4 +++- dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_non_standby_slaves_upgrade.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_non_standby_slaves_upgrade.py index 402df51324..8c256e31da 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_non_standby_slaves_upgrade.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/mysql_non_standby_slaves_upgrade.py @@ -31,6 +31,7 @@ from backend.flow.engine.bamboo.scene.mysql.common.slave_recover_switch import slave_migrate_switch_sub_flow from backend.flow.engine.bamboo.scene.mysql.common.uninstall_instance import uninstall_instance_sub_flow from backend.flow.plugins.components.collections.common.download_backup_client import DownloadBackupClientComponent +from backend.flow.plugins.components.collections.common.pause import PauseComponent from backend.flow.plugins.components.collections.mysql.clear_machine import MySQLClearMachineComponent from backend.flow.plugins.components.collections.mysql.exec_actuator_script import ExecuteDBActuatorScriptComponent from backend.flow.plugins.components.collections.mysql.mysql_db_meta import MySQLDBMetaComponent @@ -200,7 +201,8 @@ def non_standby_slaves_upgrade_subflow( root_id, parent_global_data, relation_cluster_ids, old_slave_ip, new_slave_ip ) sub_pipeline.add_parallel_sub_pipeline(switch_sub_pipeline_list) - + # 切换完成后,确认卸载旧的从节点 + sub_pipeline.add_act(act_name=_("确认卸载旧实例"), act_component_code=PauseComponent.code, kwargs={}) # 卸载旧从节点 uninstall_svr_sub_pipeline = build_uninstall_sub_pipeline( root_id, parent_global_data, old_slave_ip, relation_cluster_ids, cluster_cls.bk_cloud_id, ports 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 d97bb57222..69f11cce97 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py @@ -258,11 +258,10 @@ def get_install_mysql_payload(self, **kwargs) -> dict: for port in install_mysql_ports: mysql_config[port] = copy.deepcopy(init_mysql_config[port]) port_str = str(port) - if self.cluster["is_upgrade"]: - if port_str in old_configs.keys(): - mysql_config[port] = self.deal_mysql_config( - db_version=version_no, init_configs=mysql_config[port], origin_configs=old_configs[port_str] - ) + if port_str in old_configs.keys(): + mysql_config[port] = self.deal_mysql_config( + db_version=version_no, init_configs=mysql_config[port], origin_configs=old_configs[port_str] + ) logger.debug("install config:", mysql_config) drs_account, dbha_account = self.get_super_account()