Skip to content

Commit

Permalink
feat: 定点回档物理备份changeMaster2 TencentBlueKing#8338
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo committed Dec 4, 2024
1 parent b66e54e commit 822438b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def rollback_data_flow(self):

# 远程备份+时间
elif self.data["rollback_type"] == RollbackType.REMOTE_AND_TIME.value:
rollback_handler = FixPointRollbackHandler(mycluster["cluster_id"])
rollback_handler = FixPointRollbackHandler(cluster_class.id)
backupinfo = rollback_handler.query_latest_backup_log(str2datetime(mycluster["rollback_time"]))
if backupinfo is None:
logger.error("cluster {} backup info not exists".format(mycluster["cluster_id"]))
Expand Down Expand Up @@ -342,7 +342,7 @@ def rollback_to_cluster_flow(self):
act_component_code=ExecuteDBActuatorScriptComponent.code,
kwargs=asdict(exec_act_kwargs),
)
# todo 屏蔽监控,停止从库备份
# 屏蔽监控,停止从库备份
rollback_pipeline.add_act(
act_name=_("屏蔽监控 {}").format(rollback_storage.ip_port),
act_component_code=MysqlCrondMonitorControlComponent.code,
Expand Down Expand Up @@ -396,7 +396,7 @@ def rollback_to_cluster_flow(self):

# 远程备份+时间
elif self.data["rollback_type"] == RollbackType.REMOTE_AND_TIME.value:
rollback_handler = FixPointRollbackHandler(mycluster["cluster_id"])
rollback_handler = FixPointRollbackHandler(cluster_class.id)
backupinfo = rollback_handler.query_latest_backup_log(str2datetime(mycluster["rollback_time"]))
if backupinfo is None:
logger.error("cluster {} backup info not exists".format(mycluster["cluster_id"]))
Expand Down Expand Up @@ -440,7 +440,6 @@ def rollback_to_cluster_flow(self):
"change_master_type": MysqlChangeMasterType.MASTERSTATUS.value,
"change_master_force": True,
}
# 获取位点信息
exec_act_kwargs.cluster = copy.deepcopy(repl_cluster)
exec_act_kwargs.exec_ip = repl_master.ejector.machine.ip
exec_act_kwargs.job_timeout = MYSQL_USUAL_JOB_TIME
Expand All @@ -453,7 +452,6 @@ def rollback_to_cluster_flow(self):
kwargs=asdict(exec_act_kwargs),
write_payload_var="show_master_status_info",
)
# 启动,或者建立组从关系
exec_act_kwargs.exec_ip = rollback_storage.machine.ip
exec_act_kwargs.get_mysql_payload_func = MysqlActPayload.tendb_remotedb_change_master.__name__
rollback_pipeline.add_act(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def remote_node_rollback(root_id: str, ticket_data: dict, cluster: dict):
}
repl_exec_act_kwargs = ExecActuatorKwargs(
bk_cloud_id=cluster["bk_cloud_id"],
cluster_type=ClusterType.TenDBHA,
cluster_type=ClusterType.TenDBCluster,
cluster=copy.deepcopy(repl_cluster),
job_timeout=MYSQL_USUAL_JOB_TIME,
)
Expand Down

0 comments on commit 822438b

Please sign in to comment.