From 9c97368eec82c5f82d9d11e2857e216adaf79722 Mon Sep 17 00:00:00 2001 From: xfwduke Date: Fri, 13 Sep 2024 09:23:45 +0800 Subject: [PATCH] fix(mysql): mysql-backup-param-error #6903 --- .../pkg/components/mysql/backupdemand/backup_demand.go | 2 +- .../engine/bamboo/scene/mysql/common/get_binlog_backup.py | 2 +- dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/backupdemand/backup_demand.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/backupdemand/backup_demand.go index 7c1bf19336..49a41e2802 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/backupdemand/backup_demand.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/backupdemand/backup_demand.go @@ -155,7 +155,7 @@ func (c *Component) GenerateBackupConfig() error { ignoreDbs = append(ignoreDbs, c.Params.IgnoreDbs...) backupConfig.LogicalBackup.Databases = strings.Join(c.Params.DbPatterns, ",") backupConfig.LogicalBackup.ExcludeDatabases = strings.Join(ignoreDbs, ",") - backupConfig.LogicalBackup.Tables = strings.Join(c.Params.IgnoreTables, ",") + backupConfig.LogicalBackup.Tables = strings.Join(c.Params.TablePatterns, ",") backupConfig.LogicalBackup.ExcludeTables = strings.Join(c.Params.IgnoreTables, ",") tf, err := db_table_filter.NewFilter( diff --git a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_binlog_backup.py b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_binlog_backup.py index 187f53bab2..f892784f90 100644 --- a/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_binlog_backup.py +++ b/dbm-ui/backend/flow/engine/bamboo/scene/mysql/common/get_binlog_backup.py @@ -19,7 +19,7 @@ def get_backup_binlog( - cluster_id: int, start_time: datetime, end_time: datetime, binlog_info: dict, minute_range=30 + cluster_id: int, start_time: datetime, end_time: datetime, binlog_info: dict, minute_range=30 ) -> dict: result = {} if start_time > end_time: diff --git a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py index e0f6c02636..8af239cca5 100644 --- a/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py +++ b/dbm-ui/backend/flow/utils/mysql/mysql_act_playload.py @@ -1861,9 +1861,9 @@ def mysql_backup_demand_payload(self, **kwargs): "custom_backup_dir": self.ticket_data.get("custom_backup_dir", ""), "shard_id": self.ticket_data.get("shard_id", 0), "backup_file_tag": self.ticket_data.get("file_tag", ""), - "db_patterns": self.ticket_data.get("db_patterns", ""), + "db_patterns": self.ticket_data.get("db_patterns", ["*"]), "ignore_dbs": self.ticket_data.get("ignore_dbs", ""), - "table_patterns": self.ticket_data.get("table_patterns", ""), + "table_patterns": self.ticket_data.get("table_patterns", ["*"]), "ignore_tables": self.ticket_data.get("ignore_tables", ""), }, },