Skip to content

Commit

Permalink
fix: 调整sqlserver的告警事件级别 #7066
Browse files Browse the repository at this point in the history
  • Loading branch information
yksitu authored and zhangzhw8 committed Sep 23, 2024
1 parent 73276af commit f2e3b94
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"algorithms": [
{
"type": "Threshold",
"level": 1,
"level": 2,
"config": [
[
{
Expand All @@ -66,7 +66,7 @@
],
"detects": [
{
"level": 1,
"level": 2,
"expression": "",
"trigger_config": {
"count": 3,
Expand Down Expand Up @@ -254,7 +254,7 @@
},
"is_enabled": true,
"monitor_indicator": "MAX(mssql_alwayson_status)",
"version": 2,
"version": 3,
"alert_source": "time_series",
"custom_conditions": [],
"export_at": "2024-04-02T16:01:58+08:00"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"algorithms": [
{
"type": "Threshold",
"level": 1,
"level": 2,
"config": [
[
{
Expand All @@ -66,7 +66,7 @@
],
"detects": [
{
"level": 1,
"level": 2,
"expression": "",
"trigger_config": {
"count": 3,
Expand Down Expand Up @@ -249,7 +249,7 @@
},
"is_enabled": true,
"monitor_indicator": "MAX(mssql_alwayson_deploy)",
"version": 2,
"version": 3,
"alert_source": "time_series",
"custom_conditions": [],
"export_at": "2024-04-02T16:01:58+08:00"
Expand Down
3 changes: 2 additions & 1 deletion dbm-ui/backend/db_services/sqlserver/rollback/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def query_dbs_by_backup_log(
def query_last_log_time(self, query_time: datetime):
"""
查询集群的最近一次上报的备份时间
拿最新的一条备份记录的备份开始时间的作为判断依据
"""
last_binlogs = self._get_log_from_bklog(
collector="mssql_binlog_result",
Expand All @@ -172,7 +173,7 @@ def query_last_log_time(self, query_time: datetime):
if not last_binlogs:
raise Exception(_("集群【{}】最近的{}天里找不到日志备份").format(self.cluster.name, BACKUP_LOG_RANGE_DAYS))

return last_binlogs[0]["backup_end_time"]
return last_binlogs[0]["backup_task_start_time"]

@staticmethod
def check_binlog_lsn_continuity(backup_logs: List[Dict], full_backup_info: Dict) -> (List[Dict], List[str]):
Expand Down

0 comments on commit f2e3b94

Please sign in to comment.