From a9d5bf82c21b743db2758aba2407314acb5e430d Mon Sep 17 00:00:00 2001 From: xfwduke Date: Sun, 17 Nov 2024 15:05:07 +0800 Subject: [PATCH] =?UTF-8?q?fix(mysql):=20=E6=A0=A1=E9=AA=8C=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E6=97=B6=E9=95=BF=20#7997?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dbactuator/pkg/components/mysql/pt_table_checksum.go | 2 +- .../dbactuator/pkg/components/peripheraltools/checksum/init.go | 3 ++- .../pkg/components/peripheraltools/checksum/runtime_config.go | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go index e9293b7664..20539d8fbd 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/mysql/pt_table_checksum.go @@ -131,7 +131,7 @@ func (c *PtTableChecksumComp) GenerateConfigFile() (err error) { c.Params.BkBizId, c.Params.ClusterId, c.Params.MasterPort, c.Params.InnerRole, "", c.Params.ImmuteDomain, c.Params.MasterIp, c.GeneralParam.RuntimeAccountParam.MonitorUser, c.GeneralParam.RuntimeAccountParam.MonitorPwd, - "http://127.0.0.1:9999", logDir, c.tools) + "http://127.0.0.1:9999", logDir, c.Params.RuntimeHour, c.tools) cfg.PtChecksum.Replicate = c.Params.ReplicateTable diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/init.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/init.go index fee7bd60d7..30507ee9aa 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/init.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/init.go @@ -48,6 +48,7 @@ type instanceInfo struct { func NewRuntimeConfig( bkBizId, clusterId, port int, role, schedule, immuteDomain, ip, user, password, apiUrl, logDir string, + runtimeHour int, tl *tools.ToolSet) *config.Config { cfg := config.Config{ BkBizId: bkBizId, @@ -71,7 +72,7 @@ func NewRuntimeConfig( Args: []map[string]interface{}{ { "name": "run-time", - "value": "2h", + "value": fmt.Sprintf("%dh", runtimeHour), }, }, Replicate: fmt.Sprintf("%s.checksum", native.INFODBA_SCHEMA), diff --git a/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/runtime_config.go b/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/runtime_config.go index 5e3775408c..927a180bfb 100644 --- a/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/runtime_config.go +++ b/dbm-services/mysql/db-tools/dbactuator/pkg/components/peripheraltools/checksum/runtime_config.go @@ -35,7 +35,7 @@ func generateRuntimeConfigIns(mcp *MySQLChecksumParam, instance *instanceInfo, r cfg := NewRuntimeConfig( instance.BkBizId, instance.ClusterId, instance.Port, instance.Role, instance.Schedule, instance.ImmuteDomain, instance.Ip, - rtap.MonitorUser, rtap.MonitorPwd, mcp.ApiUrl, logDir, tl) + rtap.MonitorUser, rtap.MonitorPwd, mcp.ApiUrl, logDir, 2, tl) cfg.SetFilter(nil, ignoreDbs, nil, nil) b, err := yaml.Marshal(&cfg)