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 b139b16 commit 5d57a97
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,13 @@ def _execute(self, data, parent_data) -> bool:
return False
else:
slave_info = res[0]["cmd_results"][0]["table_data"][0]
slave_delay = 0
if slave_info["Seconds_Behind_Master"] is not None:
slave_delay = int(slave_info["Seconds_Behind_Master"])
if (
slave_info["Slave_IO_Running"] == "Yes"
and slave_info["Slave_SQL_Running"] == "Yes"
and int(slave_info["Seconds_Behind_Master"]) <= 300
and slave_delay <= 300
):
return True
else:
Expand Down

0 comments on commit 5d57a97

Please sign in to comment.