Skip to content

Commit

Permalink
feat: tendbHa定点回档增加slave延迟检查 TencentBlueKing#9096
Browse files Browse the repository at this point in the history
  • Loading branch information
zfrendo committed Jan 17, 2025
1 parent fbff0f2 commit b139b16
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ class MySQLCheckSlaveDelayService(BaseService):
def _execute(self, data, parent_data) -> bool:
kwargs = data.get_one_of_inputs("kwargs")
self.log_info(_("传入参数:{}").format(kwargs))
self.log_info(_("检查从库是否延迟,为保证定点回档前清理回档的库会同步到所有从节点。如果检查不通过可手动处理并跳过此节点。"))
self.log_info(
_("检查从库是否延迟,为保证定点回档前清理回档的库会同步到所有从节点。如果检查不通过,您可以检查目标集群延迟情况,根据自己实际需求来跳过此节点。" "只要确保回档的库已清理,跳过该节点不影响后续流程。")
)
res = DRSApi.rpc(
{
"addresses": ["{}{}{}".format(kwargs["instance_ip"], IP_PORT_DIVIDER, kwargs["instance_port"])],
"cmds": "show slave status",
"cmds": ["show slave status"],
"force": False,
"bk_cloud_id": kwargs["bk_cloud_id"],
}
Expand All @@ -49,7 +51,7 @@ def _execute(self, data, parent_data) -> bool:
if (
slave_info["Slave_IO_Running"] == "Yes"
and slave_info["Slave_SQL_Running"] == "Yes"
and slave_info["Seconds_Behind_Master"] <= 300
and int(slave_info["Seconds_Behind_Master"]) <= 300
):
return True
else:
Expand Down

0 comments on commit b139b16

Please sign in to comment.