Skip to content

Commit

Permalink
fix: 修复中控切换时没有对旧primary信息删除 #5037
Browse files Browse the repository at this point in the history
  • Loading branch information
yksitu authored and jinquantianxia committed Jun 20, 2024
1 parent 0f417fa commit 71953fb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ def _new_master_enable_primary(self, cluster: Cluster, new_master: str, reduce_c
raise CtlSwitchToSlaveFailedException(
message=_("select mysql.servers failed: {}".format(res[0]["error_msg"]))
)
if not res[0]["cmd_results"][0]["table_data"]:
if not res[0]["cmd_results"][1]["table_data"]:
self.log_warning(f"Node [{reduce_ctl_primary}] no longer has routing information")
else:
server_name = res[0]["cmd_results"][0]["table_data"][0]["Server_name"]
server_name = res[0]["cmd_results"][1]["table_data"][0]["Server_name"]

# 新primary需要执行reset slave, 避免提升主报错
rpc_params["cmds"] = ["set tc_admin=0", "reset slave all;"]
Expand Down

0 comments on commit 71953fb

Please sign in to comment.