diff --git a/checker/check_test.go b/checker/check_test.go index 74df44be93..16c37d7c40 100644 --- a/checker/check_test.go +++ b/checker/check_test.go @@ -23,6 +23,7 @@ import ( router "github.com/pingcap/tidb-tools/pkg/table-router" "github.com/pingcap/dm/dm/config" + "github.com/pingcap/dm/dm/ctl/common" "github.com/pingcap/dm/pkg/conn" tc "github.com/pingcap/check" @@ -75,16 +76,17 @@ func ignoreExcept(itemMap map[string]struct{}) []string { } func (s *testCheckerSuite) TestIgnoreAllCheckingItems(c *tc.C) { - c.Assert(CheckSyncConfig(context.Background(), nil), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), nil, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) cfgs := []*config.SubTaskConfig{ { IgnoreCheckingItems: []string{config.AllChecking}, }, } - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } +// nolint:dupl func (s *testCheckerSuite) TestDumpPrivilegeChecking(c *tc.C) { cfgs := []*config.SubTaskConfig{ { @@ -94,16 +96,17 @@ func (s *testCheckerSuite) TestDumpPrivilegeChecking(c *tc.C) { mock := s.initMockDB(c) mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}). AddRow("GRANT USAGE ON *.* TO 'haha'@'%'")) - err := CheckSyncConfig(context.Background(), cfgs) + err := CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt) c.Assert(err, tc.ErrorMatches, "(.|\n)*lack.*RELOAD(.|\n)*") c.Assert(err, tc.ErrorMatches, "(.|\n)*lack.*Select(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}). AddRow("GRANT RELOAD,SELECT ON *.* TO 'haha'@'%'")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } +// nolint:dupl func (s *testCheckerSuite) TestReplicationPrivilegeChecking(c *tc.C) { cfgs := []*config.SubTaskConfig{ { @@ -113,14 +116,14 @@ func (s *testCheckerSuite) TestReplicationPrivilegeChecking(c *tc.C) { mock := s.initMockDB(c) mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}). AddRow("GRANT USAGE ON *.* TO 'haha'@'%'")) - err := CheckSyncConfig(context.Background(), cfgs) + err := CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt) c.Assert(err, tc.ErrorMatches, "(.|\n)*lack.*REPLICATION SLAVE(.|\n)*") c.Assert(err, tc.ErrorMatches, "(.|\n)*lack.*REPLICATION CLIENT(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW GRANTS").WillReturnRows(sqlmock.NewRows([]string{"Grants for User"}). AddRow("GRANT REPLICATION SLAVE,REPLICATION CLIENT ON *.* TO 'haha'@'%'")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestVersionChecking(c *tc.C) { @@ -133,22 +136,22 @@ func (s *testCheckerSuite) TestVersionChecking(c *tc.C) { mock := s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("version", "5.7.26-log")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) mock = s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("version", "10.1.29-MariaDB")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) mock = s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("version", "5.5.26-log")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*version required at least .* but got 5.5.26(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*version required at least .* but got 5.5.26(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("version", "10.0.0-MariaDB")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*version required at least .* but got 10.0.0(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*version required at least .* but got 10.0.0(.|\n)*") } func (s *testCheckerSuite) TestServerIDChecking(c *tc.C) { @@ -161,12 +164,12 @@ func (s *testCheckerSuite) TestServerIDChecking(c *tc.C) { mock := s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'server_id'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("server_id", "0")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*please set server_id greater than 0(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*please set server_id greater than 0(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'server_id'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("server_id", "1")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestBinlogEnableChecking(c *tc.C) { @@ -179,12 +182,12 @@ func (s *testCheckerSuite) TestBinlogEnableChecking(c *tc.C) { mock := s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'log_bin'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("log_bin", "OFF")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*log_bin is OFF, and should be ON(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*log_bin is OFF, and should be ON(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'log_bin'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("log_bin", "ON")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestBinlogFormatChecking(c *tc.C) { @@ -197,12 +200,12 @@ func (s *testCheckerSuite) TestBinlogFormatChecking(c *tc.C) { mock := s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'binlog_format'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("binlog_format", "STATEMENT")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*binlog_format is STATEMENT, and should be ROW(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*binlog_format is STATEMENT, and should be ROW(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'binlog_format'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("binlog_format", "ROW")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestBinlogRowImageChecking(c *tc.C) { @@ -217,14 +220,14 @@ func (s *testCheckerSuite) TestBinlogRowImageChecking(c *tc.C) { AddRow("version", "5.7.26-log")) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'binlog_row_image'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("binlog_row_image", "MINIMAL")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*binlog_row_image is MINIMAL, and should be FULL(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*binlog_row_image is MINIMAL, and should be FULL(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'version'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("version", "10.1.29-MariaDB")) mock.ExpectQuery("SHOW GLOBAL VARIABLES LIKE 'binlog_row_image'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}). AddRow("binlog_row_image", "FULL")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestTableSchemaChecking(c *tc.C) { @@ -256,7 +259,7 @@ func (s *testCheckerSuite) TestTableSchemaChecking(c *tc.C) { mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb2))) mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*primary/unique key does not exist(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*primary/unique key does not exist(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW DATABASES").WillReturnRows(sqlmock.NewRows([]string{"DATABASE"}).AddRow(schema)) @@ -265,7 +268,7 @@ func (s *testCheckerSuite) TestTableSchemaChecking(c *tc.C) { mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable2, tb2))) mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestShardTableSchemaChecking(c *tc.C) { @@ -303,7 +306,7 @@ func (s *testCheckerSuite) TestShardTableSchemaChecking(c *tc.C) { mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb1))) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable2, tb2))) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*different column definition(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*different column definition(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW DATABASES").WillReturnRows(sqlmock.NewRows([]string{"DATABASE"}).AddRow(schema)) @@ -311,7 +314,7 @@ func (s *testCheckerSuite) TestShardTableSchemaChecking(c *tc.C) { mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb1))) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb2))) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestShardAutoIncrementIDChecking(c *tc.C) { @@ -354,7 +357,7 @@ func (s *testCheckerSuite) TestShardAutoIncrementIDChecking(c *tc.C) { mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb1))) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb2))) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*instance table .* of sharding .* have auto-increment key(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*instance table .* of sharding .* have auto-increment key(.|\n)*") mock = s.initMockDB(c) mock.ExpectQuery("SHOW DATABASES").WillReturnRows(sqlmock.NewRows([]string{"DATABASE"}).AddRow(schema)) @@ -362,7 +365,7 @@ func (s *testCheckerSuite) TestShardAutoIncrementIDChecking(c *tc.C) { mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable2, tb1))) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable2, tb2))) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.IsNil) + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.IsNil) } func (s *testCheckerSuite) TestSameTargetTableDetection(c *tc.C) { @@ -403,5 +406,5 @@ func (s *testCheckerSuite) TestSameTargetTableDetection(c *tc.C) { mock.ExpectQuery("SHOW VARIABLES LIKE 'sql_mode'").WillReturnRows(sqlmock.NewRows([]string{"Variable_name", "Value"}).AddRow("sql_mode", "")) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb1))) mock.ExpectQuery("SHOW CREATE TABLE .*").WillReturnRows(sqlmock.NewRows([]string{"Table", "Create Table"}).AddRow(tb1, fmt.Sprintf(createTable1, tb2))) - c.Assert(CheckSyncConfig(context.Background(), cfgs), tc.ErrorMatches, "(.|\n)*same table name in case-insensitive(.|\n)*") + c.Assert(CheckSyncConfig(context.Background(), cfgs, common.DefaultErrorCnt, common.DefaultWarnCnt), tc.ErrorMatches, "(.|\n)*same table name in case-insensitive(.|\n)*") } diff --git a/checker/checker.go b/checker/checker.go index 035d230ea0..bde2c77455 100644 --- a/checker/checker.go +++ b/checker/checker.go @@ -75,14 +75,18 @@ type Checker struct { sync.RWMutex detail *check.Results } + errCnt int64 + warnCnt int64 } // NewChecker returns a checker. -func NewChecker(cfgs []*config.SubTaskConfig, checkingItems map[string]string) *Checker { +func NewChecker(cfgs []*config.SubTaskConfig, checkingItems map[string]string, errCnt, warnCnt int64) *Checker { c := &Checker{ instances: make([]*mysqlInstance, 0, len(cfgs)), checkingItems: checkingItems, logger: log.With(zap.String("unit", "task check")), + errCnt: errCnt, + warnCnt: warnCnt, } for _, cfg := range cfgs { @@ -261,9 +265,21 @@ func (c *Checker) Process(ctx context.Context, pr chan pb.ProcessResult) { // remove success result if not pass results := result.Results[:0] + var warnCnt int64 = 0 + var errCnt int64 = 0 for _, r := range result.Results { - if r.State != check.StateSuccess { - results = append(results, r) + switch r.State { + case check.StateFailure: + if errCnt < c.errCnt { + errCnt++ + results = append(results, r) + } + case check.StateWarning: + if warnCnt < c.warnCnt { + warnCnt++ + results = append(results, r) + } + default: } } result.Results = results diff --git a/checker/cmd.go b/checker/cmd.go index af3703fdb1..caedaa4eff 100644 --- a/checker/cmd.go +++ b/checker/cmd.go @@ -26,7 +26,7 @@ var ( ErrorMsgHeader = "fail to check synchronization configuration with type" // CheckSyncConfigFunc holds the CheckSyncConfig function. - CheckSyncConfigFunc func(ctx context.Context, cfgs []*config.SubTaskConfig) error + CheckSyncConfigFunc func(ctx context.Context, cfgs []*config.SubTaskConfig, errCnt, warnCnt int64) error ) func init() { @@ -34,7 +34,7 @@ func init() { } // CheckSyncConfig checks synchronization configuration. -func CheckSyncConfig(ctx context.Context, cfgs []*config.SubTaskConfig) error { +func CheckSyncConfig(ctx context.Context, cfgs []*config.SubTaskConfig, errCnt, warnCnt int64) error { if len(cfgs) == 0 { return nil } @@ -56,7 +56,7 @@ func CheckSyncConfig(ctx context.Context, cfgs []*config.SubTaskConfig) error { return nil } - c := NewChecker(cfgs, checkingItems) + c := NewChecker(cfgs, checkingItems, errCnt, warnCnt) if err := c.Init(ctx); err != nil { return terror.Annotate(err, "fail to initial checker") diff --git a/dm/ctl/common/config.go b/dm/ctl/common/config.go index 1e4a38f3ae..5369fddd71 100644 --- a/dm/ctl/common/config.go +++ b/dm/ctl/common/config.go @@ -45,6 +45,11 @@ const ( keepaliveTimeout = 3 * time.Second keepaliveTime = 3 * time.Second syncMasterEndpointsTime = 3 * time.Second + + // DefaultErrorCnt represents default count of errors to display for check-task. + DefaultErrorCnt = 10 + // DefaultWarnCnt represents count of warns to display for check-task. + DefaultWarnCnt = 10 ) // NewConfig creates a new base config for dmctl. diff --git a/dm/ctl/master/check_task.go b/dm/ctl/master/check_task.go index 3e772dd259..9bbd03beee 100644 --- a/dm/ctl/master/check_task.go +++ b/dm/ctl/master/check_task.go @@ -28,10 +28,12 @@ import ( // NewCheckTaskCmd creates a CheckTask command. func NewCheckTaskCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "check-task ", + Use: "check-task [--error count] [--warn count]", Short: "Checks the configuration file of the task.", RunE: checkTaskFunc, } + cmd.Flags().Int64P("error", "e", common.DefaultErrorCnt, "max count of errors to display") + cmd.Flags().Int64P("warn", "w", common.DefaultWarnCnt, "max count of warns to display") return cmd } @@ -47,6 +49,15 @@ func checkTaskFunc(cmd *cobra.Command, _ []string) error { return err } + errCnt, err := cmd.Flags().GetInt64("error") + if err != nil { + return err + } + warnCnt, err := cmd.Flags().GetInt64("warn") + if err != nil { + return err + } + ctx, cancel := context.WithCancel(context.Background()) defer cancel() @@ -56,7 +67,9 @@ func checkTaskFunc(cmd *cobra.Command, _ []string) error { ctx, "CheckTask", &pb.CheckTaskRequest{ - Task: string(content), + Task: string(content), + ErrCnt: errCnt, + WarnCnt: warnCnt, }, &resp, ) diff --git a/dm/master/server.go b/dm/master/server.go index 7a8a825a61..a6d4e366a0 100644 --- a/dm/master/server.go +++ b/dm/master/server.go @@ -409,7 +409,7 @@ func (s *Server) StartTask(ctx context.Context, req *pb.StartTaskRequest) (*pb.S } resp := &pb.StartTaskResponse{} - cfg, stCfgs, err := s.generateSubTask(ctx, req.Task) + cfg, stCfgs, err := s.generateSubTask(ctx, req.Task, common.DefaultErrorCnt, common.DefaultWarnCnt) if err != nil { resp.Msg = err.Error() // nolint:nilerr @@ -581,7 +581,7 @@ func (s *Server) UpdateTask(ctx context.Context, req *pb.UpdateTaskRequest) (*pb return resp2, err2 } - cfg, stCfgs, err := s.generateSubTask(ctx, req.Task) + cfg, stCfgs, err := s.generateSubTask(ctx, req.Task, common.DefaultErrorCnt, common.DefaultWarnCnt) if err != nil { // nolint:nilerr return &pb.UpdateTaskResponse{ @@ -1037,7 +1037,7 @@ func (s *Server) CheckTask(ctx context.Context, req *pb.CheckTaskRequest) (*pb.C return resp2, err2 } - _, _, err := s.generateSubTask(ctx, req.Task) + _, _, err := s.generateSubTask(ctx, req.Task, req.ErrCnt, req.WarnCnt) if err != nil { // nolint:nilerr return &pb.CheckTaskResponse{ @@ -1300,7 +1300,7 @@ func (s *Server) OperateLeader(ctx context.Context, req *pb.OperateLeaderRequest }, nil } -func (s *Server) generateSubTask(ctx context.Context, task string) (*config.TaskConfig, []*config.SubTaskConfig, error) { +func (s *Server) generateSubTask(ctx context.Context, task string, errCnt, warnCnt int64) (*config.TaskConfig, []*config.SubTaskConfig, error) { cfg := config.NewTaskConfig() err := cfg.Decode(task) if err != nil { @@ -1319,7 +1319,7 @@ func (s *Server) generateSubTask(ctx context.Context, task string) (*config.Task return nil, nil, terror.WithClass(err, terror.ClassDMMaster) } - err = checker.CheckSyncConfigFunc(ctx, stCfgs) + err = checker.CheckSyncConfigFunc(ctx, stCfgs, errCnt, warnCnt) if err != nil { return nil, nil, terror.WithClass(err, terror.ClassDMMaster) } diff --git a/dm/master/server_test.go b/dm/master/server_test.go index a0e419b091..2b3c7a33db 100644 --- a/dm/master/server_test.go +++ b/dm/master/server_test.go @@ -497,7 +497,7 @@ func (t *testMaster) TestStartTask(c *check.C) { // test start task, but the first step check-task fails bakCheckSyncConfigFunc := checker.CheckSyncConfigFunc - checker.CheckSyncConfigFunc = func(_ context.Context, _ []*config.SubTaskConfig) error { + checker.CheckSyncConfigFunc = func(_ context.Context, _ []*config.SubTaskConfig, _, _ int64) error { return errors.New(errCheckSyncConfig) } defer func() { diff --git a/dm/pb/dmmaster.pb.go b/dm/pb/dmmaster.pb.go index 04d767c437..216fb036ea 100644 --- a/dm/pb/dmmaster.pb.go +++ b/dm/pb/dmmaster.pb.go @@ -1227,7 +1227,9 @@ func (m *PurgeWorkerRelayResponse) GetSources() []*CommonWorkerResponse { } type CheckTaskRequest struct { - Task string `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + Task string `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` + ErrCnt int64 `protobuf:"varint,2,opt,name=errCnt,proto3" json:"errCnt,omitempty"` + WarnCnt int64 `protobuf:"varint,3,opt,name=warnCnt,proto3" json:"warnCnt,omitempty"` } func (m *CheckTaskRequest) Reset() { *m = CheckTaskRequest{} } @@ -1270,6 +1272,20 @@ func (m *CheckTaskRequest) GetTask() string { return "" } +func (m *CheckTaskRequest) GetErrCnt() int64 { + if m != nil { + return m.ErrCnt + } + return 0 +} + +func (m *CheckTaskRequest) GetWarnCnt() int64 { + if m != nil { + return m.WarnCnt + } + return 0 +} + type CheckTaskResponse struct { Result bool `protobuf:"varint,1,opt,name=result,proto3" json:"result,omitempty"` Msg string `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"` @@ -3148,134 +3164,135 @@ func init() { func init() { proto.RegisterFile("dmmaster.proto", fileDescriptor_f9bef11f2a341f03) } var fileDescriptor_f9bef11f2a341f03 = []byte{ - // 2018 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0x5f, 0x6f, 0xdb, 0xc8, - 0x11, 0x17, 0x25, 0xc5, 0x96, 0x47, 0xb6, 0x4e, 0x5e, 0xcb, 0x32, 0xc3, 0x38, 0x8a, 0x6f, 0x7b, - 0x17, 0x18, 0x46, 0x11, 0x23, 0x6e, 0x9f, 0x0e, 0xb8, 0xa2, 0x17, 0x2b, 0x97, 0x33, 0xaa, 0xd4, - 0x57, 0x3a, 0xb9, 0xf6, 0x50, 0xa0, 0x38, 0x4a, 0x5a, 0xc9, 0x84, 0x29, 0x92, 0x21, 0x29, 0xbb, - 0x46, 0x70, 0x2f, 0xfd, 0x00, 0xfd, 0x83, 0x3e, 0xdc, 0x63, 0x1f, 0xfa, 0x4d, 0xfa, 0xd4, 0xc7, - 0x00, 0x05, 0x8a, 0x3e, 0x16, 0x49, 0x3f, 0x48, 0xb1, 0xb3, 0x4b, 0x72, 0xf9, 0x47, 0x6e, 0x15, - 0xe0, 0xfc, 0xc6, 0x99, 0x59, 0xcd, 0xfc, 0xe6, 0xcf, 0xce, 0xce, 0xae, 0xa0, 0x35, 0x9e, 0xcd, - 0xac, 0x30, 0x62, 0xc1, 0x23, 0x3f, 0xf0, 0x22, 0x8f, 0x54, 0xfd, 0xa1, 0xd1, 0x1a, 0xcf, 0xae, - 0xbc, 0xe0, 0x22, 0xe6, 0x19, 0xbb, 0x53, 0xcf, 0x9b, 0x3a, 0xec, 0xd0, 0xf2, 0xed, 0x43, 0xcb, - 0x75, 0xbd, 0xc8, 0x8a, 0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, 0x9a, 0x92, 0x5e, - 0x14, 0xc4, 0x4a, 0x9e, 0xe8, 0x7f, 0x7f, 0xdb, 0xd3, 0xde, 0xbc, 0xed, 0x69, 0xff, 0x7e, 0xdb, - 0xd3, 0xfe, 0xf8, 0xae, 0x57, 0x79, 0xf3, 0xae, 0x57, 0xf9, 0xd7, 0xbb, 0x5e, 0x65, 0xb8, 0x82, - 0xff, 0x85, 0xfd, 0xe8, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x8a, 0x3d, 0xfc, 0xd4, 0x4f, 0x1b, - 0x00, 0x00, + // 2040 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0x5f, 0x6f, 0x1b, 0xc7, + 0x11, 0xe7, 0x91, 0x34, 0x45, 0x0d, 0x25, 0x86, 0x5e, 0x51, 0xd4, 0xf9, 0x2c, 0xd3, 0xca, 0x36, + 0x09, 0x04, 0xa1, 0xb0, 0x60, 0xb5, 0x4f, 0x01, 0x52, 0x34, 0x26, 0x1d, 0x47, 0xa8, 0x5c, 0xa5, + 0x27, 0x3b, 0x4d, 0x50, 0xa0, 0xc8, 0x91, 0x5c, 0x52, 0x07, 0x1d, 0xef, 0xce, 0x77, 0x47, 0xa9, + 0x82, 0x91, 0x97, 0x7e, 0x80, 0xfe, 0x41, 0x1f, 0xf2, 0xd8, 0x87, 0x7e, 0x93, 0x3e, 0xf5, 0x31, + 0x40, 0x81, 0xa2, 0x8f, 0x85, 0xdd, 0x0f, 0x52, 0xec, 0xec, 0xde, 0xdd, 0xde, 0x1f, 0xaa, 0xa5, + 0x81, 0xea, 0xed, 0x66, 0x66, 0x39, 0xf3, 0x9b, 0x3f, 0x3b, 0x3b, 0xbb, 0x84, 0xf6, 0x64, 0x3e, + 0xb7, 0xc2, 0x88, 0x05, 0x8f, 0xfc, 0xc0, 0x8b, 0x3c, 0x52, 0xf5, 0x47, 0x46, 0x7b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a, 0x8c, 0x84, 0xe3, 0xe9, 0x8c, 0x6e, 0xc3, 0xd6, 0x33, 0x26, 0xf7, 0x65, 0x8a, 0x8c, 0xee, + 0x63, 0xb4, 0x14, 0xb6, 0x34, 0x25, 0x15, 0x68, 0xa9, 0x82, 0x3f, 0x6a, 0x40, 0x3e, 0xb7, 0xdc, + 0x89, 0xc3, 0x9e, 0x06, 0x81, 0x17, 0x2c, 0x9d, 0x83, 0x51, 0xfa, 0x4e, 0x45, 0xba, 0x0b, 0xeb, + 0x23, 0xdb, 0x75, 0xbc, 0xd9, 0x17, 0x5e, 0x28, 0xab, 0x34, 0x65, 0x60, 0x89, 0xbd, 0x72, 0x92, + 0xbb, 0x0e, 0xff, 0xa6, 0x21, 0x6c, 0x65, 0x20, 0xdd, 0x4a, 0x81, 0x3d, 0x83, 0xed, 0x17, 0x81, + 0xe5, 0x86, 0x53, 0x16, 0x64, 0x87, 0xaf, 0xf4, 0x3c, 0xd1, 0xd4, 0xf3, 0x44, 0x69, 0x3b, 0xc2, + 0xb2, 0xa4, 0xf8, 0x70, 0x92, 0x57, 0xb4, 0xf2, 0x01, 0x3d, 0x49, 0x1e, 0x2a, 0x32, 0x03, 0xfb, + 0x03, 0x25, 0x2b, 0x9b, 0xca, 0x3d, 0xe2, 0xcb, 0xa3, 0x78, 0x10, 0x94, 0x48, 0xab, 0x4b, 0x90, + 0x8a, 0xd4, 0xc4, 0x48, 0x7f, 0x9a, 0xb4, 0xa8, 0x77, 0x9c, 0xbe, 0x0f, 0x46, 0xd0, 0x8c, 0x47, + 0x51, 0xb2, 0x05, 0xef, 0x1d, 0xbb, 0x97, 0x96, 0x63, 0x4f, 0x62, 0x56, 0xa7, 0x42, 0xde, 0x83, + 0x16, 0xbe, 0x22, 0x09, 0x56, 0x47, 0x23, 0x1d, 0xd8, 0x10, 0xcf, 0x15, 0x92, 0x53, 0x25, 0x6d, + 0x80, 0xb3, 0xc8, 0xf3, 0x25, 0x5d, 0x43, 0xfa, 0xdc,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, 0x06, 0xb0, 0xa1, 0x0e, 0x8a, + 0xa2, 0xe9, 0x95, 0x4c, 0x94, 0x86, 0x5e, 0x14, 0x24, 0x1b, 0xe2, 0x18, 0xda, 0xd9, 0x89, 0x47, + 0xec, 0xad, 0xd2, 0x71, 0x4a, 0xec, 0xad, 0xf2, 0x01, 0x89, 0x56, 0x38, 0x1e, 0x75, 0x24, 0x21, + 0xea, 0x11, 0x94, 0x69, 0x4a, 0x7a, 0x51, 0x10, 0x2b, 0x79, 0xa2, 0xff, 0xed, 0x4d, 0x5f, 0xfb, + 0xfe, 0x4d, 0x5f, 0xfb, 0xd7, 0x9b, 0xbe, 0xf6, 0x87, 0xb7, 0xfd, 0xca, 0xf7, 0x6f, 0xfb, 0x95, + 0x7f, 0xbe, 0xed, 0x57, 0x46, 0x0d, 0xfc, 0xf7, 0xec, 0x47, 0xff, 0x09, 0x00, 0x00, 0xff, 0xff, + 0x8d, 0x0a, 0x25, 0x8c, 0x81, 0x1b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -4985,6 +5002,16 @@ func (m *CheckTaskRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.WarnCnt != 0 { + i = encodeVarintDmmaster(dAtA, i, uint64(m.WarnCnt)) + i-- + dAtA[i] = 0x18 + } + if m.ErrCnt != 0 { + i = encodeVarintDmmaster(dAtA, i, uint64(m.ErrCnt)) + i-- + dAtA[i] = 0x10 + } if len(m.Task) > 0 { i -= len(m.Task) copy(dAtA[i:], m.Task) @@ -6850,6 +6877,12 @@ func (m *CheckTaskRequest) Size() (n int) { if l > 0 { n += 1 + l + sovDmmaster(uint64(l)) } + if m.ErrCnt != 0 { + n += 1 + sovDmmaster(uint64(m.ErrCnt)) + } + if m.WarnCnt != 0 { + n += 1 + sovDmmaster(uint64(m.WarnCnt)) + } return n } @@ -10011,6 +10044,44 @@ func (m *CheckTaskRequest) Unmarshal(dAtA []byte) error { } m.Task = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ErrCnt", wireType) + } + m.ErrCnt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmmaster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ErrCnt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field WarnCnt", wireType) + } + m.WarnCnt = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmmaster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.WarnCnt |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipDmmaster(dAtA[iNdEx:]) diff --git a/dm/pbmock/dmmaster.go b/dm/pbmock/dmmaster.go index 55c0174116..39f9123c3f 100644 --- a/dm/pbmock/dmmaster.go +++ b/dm/pbmock/dmmaster.go @@ -6,36 +6,37 @@ package pbmock import ( context "context" + reflect "reflect" + gomock "github.com/golang/mock/gomock" pb "github.com/pingcap/dm/dm/pb" grpc "google.golang.org/grpc" - reflect "reflect" ) -// MockMasterClient is a mock of MasterClient interface +// MockMasterClient is a mock of MasterClient interface. type MockMasterClient struct { ctrl *gomock.Controller recorder *MockMasterClientMockRecorder } -// MockMasterClientMockRecorder is the mock recorder for MockMasterClient +// MockMasterClientMockRecorder is the mock recorder for MockMasterClient. type MockMasterClientMockRecorder struct { mock *MockMasterClient } -// NewMockMasterClient creates a new mock instance +// NewMockMasterClient creates a new mock instance. func NewMockMasterClient(ctrl *gomock.Controller) *MockMasterClient { mock := &MockMasterClient{ctrl: ctrl} mock.recorder = &MockMasterClientMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockMasterClient) EXPECT() *MockMasterClientMockRecorder { return m.recorder } -// CheckTask mocks base method +// CheckTask mocks base method. func (m *MockMasterClient) CheckTask(arg0 context.Context, arg1 *pb.CheckTaskRequest, arg2 ...grpc.CallOption) (*pb.CheckTaskResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -48,14 +49,14 @@ func (m *MockMasterClient) CheckTask(arg0 context.Context, arg1 *pb.CheckTaskReq return ret0, ret1 } -// CheckTask indicates an expected call of CheckTask +// CheckTask indicates an expected call of CheckTask. func (mr *MockMasterClientMockRecorder) CheckTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckTask", reflect.TypeOf((*MockMasterClient)(nil).CheckTask), varargs...) } -// GetCfg mocks base method +// GetCfg mocks base method. func (m *MockMasterClient) GetCfg(arg0 context.Context, arg1 *pb.GetCfgRequest, arg2 ...grpc.CallOption) (*pb.GetCfgResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -68,14 +69,14 @@ func (m *MockMasterClient) GetCfg(arg0 context.Context, arg1 *pb.GetCfgRequest, return ret0, ret1 } -// GetCfg indicates an expected call of GetCfg +// GetCfg indicates an expected call of GetCfg. func (mr *MockMasterClientMockRecorder) GetCfg(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCfg", reflect.TypeOf((*MockMasterClient)(nil).GetCfg), varargs...) } -// GetMasterCfg mocks base method +// GetMasterCfg mocks base method. func (m *MockMasterClient) GetMasterCfg(arg0 context.Context, arg1 *pb.GetMasterCfgRequest, arg2 ...grpc.CallOption) (*pb.GetMasterCfgResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -88,14 +89,14 @@ func (m *MockMasterClient) GetMasterCfg(arg0 context.Context, arg1 *pb.GetMaster return ret0, ret1 } -// GetMasterCfg indicates an expected call of GetMasterCfg +// GetMasterCfg indicates an expected call of GetMasterCfg. func (mr *MockMasterClientMockRecorder) GetMasterCfg(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMasterCfg", reflect.TypeOf((*MockMasterClient)(nil).GetMasterCfg), varargs...) } -// GetSubTaskCfg mocks base method +// GetSubTaskCfg mocks base method. func (m *MockMasterClient) GetSubTaskCfg(arg0 context.Context, arg1 *pb.GetSubTaskCfgRequest, arg2 ...grpc.CallOption) (*pb.GetSubTaskCfgResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -108,14 +109,14 @@ func (m *MockMasterClient) GetSubTaskCfg(arg0 context.Context, arg1 *pb.GetSubTa return ret0, ret1 } -// GetSubTaskCfg indicates an expected call of GetSubTaskCfg +// GetSubTaskCfg indicates an expected call of GetSubTaskCfg. func (mr *MockMasterClientMockRecorder) GetSubTaskCfg(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubTaskCfg", reflect.TypeOf((*MockMasterClient)(nil).GetSubTaskCfg), varargs...) } -// HandleError mocks base method +// HandleError mocks base method. func (m *MockMasterClient) HandleError(arg0 context.Context, arg1 *pb.HandleErrorRequest, arg2 ...grpc.CallOption) (*pb.HandleErrorResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -128,14 +129,14 @@ func (m *MockMasterClient) HandleError(arg0 context.Context, arg1 *pb.HandleErro return ret0, ret1 } -// HandleError indicates an expected call of HandleError +// HandleError indicates an expected call of HandleError. func (mr *MockMasterClientMockRecorder) HandleError(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleError", reflect.TypeOf((*MockMasterClient)(nil).HandleError), varargs...) } -// ListMember mocks base method +// ListMember mocks base method. func (m *MockMasterClient) ListMember(arg0 context.Context, arg1 *pb.ListMemberRequest, arg2 ...grpc.CallOption) (*pb.ListMemberResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -148,14 +149,14 @@ func (m *MockMasterClient) ListMember(arg0 context.Context, arg1 *pb.ListMemberR return ret0, ret1 } -// ListMember indicates an expected call of ListMember +// ListMember indicates an expected call of ListMember. func (mr *MockMasterClientMockRecorder) ListMember(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMember", reflect.TypeOf((*MockMasterClient)(nil).ListMember), varargs...) } -// OfflineMember mocks base method +// OfflineMember mocks base method. func (m *MockMasterClient) OfflineMember(arg0 context.Context, arg1 *pb.OfflineMemberRequest, arg2 ...grpc.CallOption) (*pb.OfflineMemberResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -168,14 +169,14 @@ func (m *MockMasterClient) OfflineMember(arg0 context.Context, arg1 *pb.OfflineM return ret0, ret1 } -// OfflineMember indicates an expected call of OfflineMember +// OfflineMember indicates an expected call of OfflineMember. func (mr *MockMasterClientMockRecorder) OfflineMember(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OfflineMember", reflect.TypeOf((*MockMasterClient)(nil).OfflineMember), varargs...) } -// OperateLeader mocks base method +// OperateLeader mocks base method. func (m *MockMasterClient) OperateLeader(arg0 context.Context, arg1 *pb.OperateLeaderRequest, arg2 ...grpc.CallOption) (*pb.OperateLeaderResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -188,14 +189,34 @@ func (m *MockMasterClient) OperateLeader(arg0 context.Context, arg1 *pb.OperateL return ret0, ret1 } -// OperateLeader indicates an expected call of OperateLeader +// OperateLeader indicates an expected call of OperateLeader. func (mr *MockMasterClientMockRecorder) OperateLeader(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateLeader", reflect.TypeOf((*MockMasterClient)(nil).OperateLeader), varargs...) } -// OperateSchema mocks base method +// OperateRelay mocks base method. +func (m *MockMasterClient) OperateRelay(arg0 context.Context, arg1 *pb.OperateRelayRequest, arg2 ...grpc.CallOption) (*pb.OperateRelayResponse, error) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0, arg1} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "OperateRelay", varargs...) + ret0, _ := ret[0].(*pb.OperateRelayResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// OperateRelay indicates an expected call of OperateRelay. +func (mr *MockMasterClientMockRecorder) OperateRelay(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0, arg1}, arg2...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateRelay", reflect.TypeOf((*MockMasterClient)(nil).OperateRelay), varargs...) +} + +// OperateSchema mocks base method. func (m *MockMasterClient) OperateSchema(arg0 context.Context, arg1 *pb.OperateSchemaRequest, arg2 ...grpc.CallOption) (*pb.OperateSchemaResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -208,14 +229,14 @@ func (m *MockMasterClient) OperateSchema(arg0 context.Context, arg1 *pb.OperateS return ret0, ret1 } -// OperateSchema indicates an expected call of OperateSchema +// OperateSchema indicates an expected call of OperateSchema. func (mr *MockMasterClientMockRecorder) OperateSchema(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateSchema", reflect.TypeOf((*MockMasterClient)(nil).OperateSchema), varargs...) } -// OperateSource mocks base method +// OperateSource mocks base method. func (m *MockMasterClient) OperateSource(arg0 context.Context, arg1 *pb.OperateSourceRequest, arg2 ...grpc.CallOption) (*pb.OperateSourceResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -228,14 +249,14 @@ func (m *MockMasterClient) OperateSource(arg0 context.Context, arg1 *pb.OperateS return ret0, ret1 } -// OperateSource indicates an expected call of OperateSource +// OperateSource indicates an expected call of OperateSource. func (mr *MockMasterClientMockRecorder) OperateSource(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateSource", reflect.TypeOf((*MockMasterClient)(nil).OperateSource), varargs...) } -// OperateTask mocks base method +// OperateTask mocks base method. func (m *MockMasterClient) OperateTask(arg0 context.Context, arg1 *pb.OperateTaskRequest, arg2 ...grpc.CallOption) (*pb.OperateTaskResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -248,14 +269,14 @@ func (m *MockMasterClient) OperateTask(arg0 context.Context, arg1 *pb.OperateTas return ret0, ret1 } -// OperateTask indicates an expected call of OperateTask +// OperateTask indicates an expected call of OperateTask. func (mr *MockMasterClientMockRecorder) OperateTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateTask", reflect.TypeOf((*MockMasterClient)(nil).OperateTask), varargs...) } -// OperateWorkerRelayTask mocks base method +// OperateWorkerRelayTask mocks base method. func (m *MockMasterClient) OperateWorkerRelayTask(arg0 context.Context, arg1 *pb.OperateWorkerRelayRequest, arg2 ...grpc.CallOption) (*pb.OperateWorkerRelayResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -268,14 +289,14 @@ func (m *MockMasterClient) OperateWorkerRelayTask(arg0 context.Context, arg1 *pb return ret0, ret1 } -// OperateWorkerRelayTask indicates an expected call of OperateWorkerRelayTask +// OperateWorkerRelayTask indicates an expected call of OperateWorkerRelayTask. func (mr *MockMasterClientMockRecorder) OperateWorkerRelayTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateWorkerRelayTask", reflect.TypeOf((*MockMasterClient)(nil).OperateWorkerRelayTask), varargs...) } -// PurgeWorkerRelay mocks base method +// PurgeWorkerRelay mocks base method. func (m *MockMasterClient) PurgeWorkerRelay(arg0 context.Context, arg1 *pb.PurgeWorkerRelayRequest, arg2 ...grpc.CallOption) (*pb.PurgeWorkerRelayResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -288,14 +309,14 @@ func (m *MockMasterClient) PurgeWorkerRelay(arg0 context.Context, arg1 *pb.Purge return ret0, ret1 } -// PurgeWorkerRelay indicates an expected call of PurgeWorkerRelay +// PurgeWorkerRelay indicates an expected call of PurgeWorkerRelay. func (mr *MockMasterClientMockRecorder) PurgeWorkerRelay(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PurgeWorkerRelay", reflect.TypeOf((*MockMasterClient)(nil).PurgeWorkerRelay), varargs...) } -// QueryStatus mocks base method +// QueryStatus mocks base method. func (m *MockMasterClient) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatusListRequest, arg2 ...grpc.CallOption) (*pb.QueryStatusListResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -308,14 +329,14 @@ func (m *MockMasterClient) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatu return ret0, ret1 } -// QueryStatus indicates an expected call of QueryStatus +// QueryStatus indicates an expected call of QueryStatus. func (mr *MockMasterClientMockRecorder) QueryStatus(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryStatus", reflect.TypeOf((*MockMasterClient)(nil).QueryStatus), varargs...) } -// RegisterWorker mocks base method +// RegisterWorker mocks base method. func (m *MockMasterClient) RegisterWorker(arg0 context.Context, arg1 *pb.RegisterWorkerRequest, arg2 ...grpc.CallOption) (*pb.RegisterWorkerResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -328,14 +349,14 @@ func (m *MockMasterClient) RegisterWorker(arg0 context.Context, arg1 *pb.Registe return ret0, ret1 } -// RegisterWorker indicates an expected call of RegisterWorker +// RegisterWorker indicates an expected call of RegisterWorker. func (mr *MockMasterClientMockRecorder) RegisterWorker(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterWorker", reflect.TypeOf((*MockMasterClient)(nil).RegisterWorker), varargs...) } -// ShowDDLLocks mocks base method +// ShowDDLLocks mocks base method. func (m *MockMasterClient) ShowDDLLocks(arg0 context.Context, arg1 *pb.ShowDDLLocksRequest, arg2 ...grpc.CallOption) (*pb.ShowDDLLocksResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -348,14 +369,14 @@ func (m *MockMasterClient) ShowDDLLocks(arg0 context.Context, arg1 *pb.ShowDDLLo return ret0, ret1 } -// ShowDDLLocks indicates an expected call of ShowDDLLocks +// ShowDDLLocks indicates an expected call of ShowDDLLocks. func (mr *MockMasterClientMockRecorder) ShowDDLLocks(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShowDDLLocks", reflect.TypeOf((*MockMasterClient)(nil).ShowDDLLocks), varargs...) } -// StartTask mocks base method +// StartTask mocks base method. func (m *MockMasterClient) StartTask(arg0 context.Context, arg1 *pb.StartTaskRequest, arg2 ...grpc.CallOption) (*pb.StartTaskResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -368,14 +389,14 @@ func (m *MockMasterClient) StartTask(arg0 context.Context, arg1 *pb.StartTaskReq return ret0, ret1 } -// StartTask indicates an expected call of StartTask +// StartTask indicates an expected call of StartTask. func (mr *MockMasterClientMockRecorder) StartTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartTask", reflect.TypeOf((*MockMasterClient)(nil).StartTask), varargs...) } -// TransferSource mocks base method +// TransferSource mocks base method. func (m *MockMasterClient) TransferSource(arg0 context.Context, arg1 *pb.TransferSourceRequest, arg2 ...grpc.CallOption) (*pb.TransferSourceResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -388,14 +409,14 @@ func (m *MockMasterClient) TransferSource(arg0 context.Context, arg1 *pb.Transfe return ret0, ret1 } -// TransferSource indicates an expected call of TransferSource +// TransferSource indicates an expected call of TransferSource. func (mr *MockMasterClientMockRecorder) TransferSource(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransferSource", reflect.TypeOf((*MockMasterClient)(nil).TransferSource), varargs...) } -// UnlockDDLLock mocks base method +// UnlockDDLLock mocks base method. func (m *MockMasterClient) UnlockDDLLock(arg0 context.Context, arg1 *pb.UnlockDDLLockRequest, arg2 ...grpc.CallOption) (*pb.UnlockDDLLockResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -408,14 +429,14 @@ func (m *MockMasterClient) UnlockDDLLock(arg0 context.Context, arg1 *pb.UnlockDD return ret0, ret1 } -// UnlockDDLLock indicates an expected call of UnlockDDLLock +// UnlockDDLLock indicates an expected call of UnlockDDLLock. func (mr *MockMasterClientMockRecorder) UnlockDDLLock(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnlockDDLLock", reflect.TypeOf((*MockMasterClient)(nil).UnlockDDLLock), varargs...) } -// UpdateTask mocks base method +// UpdateTask mocks base method. func (m *MockMasterClient) UpdateTask(arg0 context.Context, arg1 *pb.UpdateTaskRequest, arg2 ...grpc.CallOption) (*pb.UpdateTaskResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -428,37 +449,37 @@ func (m *MockMasterClient) UpdateTask(arg0 context.Context, arg1 *pb.UpdateTaskR return ret0, ret1 } -// UpdateTask indicates an expected call of UpdateTask +// UpdateTask indicates an expected call of UpdateTask. func (mr *MockMasterClientMockRecorder) UpdateTask(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTask", reflect.TypeOf((*MockMasterClient)(nil).UpdateTask), varargs...) } -// MockMasterServer is a mock of MasterServer interface +// MockMasterServer is a mock of MasterServer interface. type MockMasterServer struct { ctrl *gomock.Controller recorder *MockMasterServerMockRecorder } -// MockMasterServerMockRecorder is the mock recorder for MockMasterServer +// MockMasterServerMockRecorder is the mock recorder for MockMasterServer. type MockMasterServerMockRecorder struct { mock *MockMasterServer } -// NewMockMasterServer creates a new mock instance +// NewMockMasterServer creates a new mock instance. func NewMockMasterServer(ctrl *gomock.Controller) *MockMasterServer { mock := &MockMasterServer{ctrl: ctrl} mock.recorder = &MockMasterServerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockMasterServer) EXPECT() *MockMasterServerMockRecorder { return m.recorder } -// CheckTask mocks base method +// CheckTask mocks base method. func (m *MockMasterServer) CheckTask(arg0 context.Context, arg1 *pb.CheckTaskRequest) (*pb.CheckTaskResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "CheckTask", arg0, arg1) @@ -467,13 +488,13 @@ func (m *MockMasterServer) CheckTask(arg0 context.Context, arg1 *pb.CheckTaskReq return ret0, ret1 } -// CheckTask indicates an expected call of CheckTask +// CheckTask indicates an expected call of CheckTask. func (mr *MockMasterServerMockRecorder) CheckTask(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckTask", reflect.TypeOf((*MockMasterServer)(nil).CheckTask), arg0, arg1) } -// GetCfg mocks base method +// GetCfg mocks base method. func (m *MockMasterServer) GetCfg(arg0 context.Context, arg1 *pb.GetCfgRequest) (*pb.GetCfgResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetCfg", arg0, arg1) @@ -482,13 +503,13 @@ func (m *MockMasterServer) GetCfg(arg0 context.Context, arg1 *pb.GetCfgRequest) return ret0, ret1 } -// GetCfg indicates an expected call of GetCfg +// GetCfg indicates an expected call of GetCfg. func (mr *MockMasterServerMockRecorder) GetCfg(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCfg", reflect.TypeOf((*MockMasterServer)(nil).GetCfg), arg0, arg1) } -// GetMasterCfg mocks base method +// GetMasterCfg mocks base method. func (m *MockMasterServer) GetMasterCfg(arg0 context.Context, arg1 *pb.GetMasterCfgRequest) (*pb.GetMasterCfgResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetMasterCfg", arg0, arg1) @@ -497,13 +518,13 @@ func (m *MockMasterServer) GetMasterCfg(arg0 context.Context, arg1 *pb.GetMaster return ret0, ret1 } -// GetMasterCfg indicates an expected call of GetMasterCfg +// GetMasterCfg indicates an expected call of GetMasterCfg. func (mr *MockMasterServerMockRecorder) GetMasterCfg(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMasterCfg", reflect.TypeOf((*MockMasterServer)(nil).GetMasterCfg), arg0, arg1) } -// GetSubTaskCfg mocks base method +// GetSubTaskCfg mocks base method. func (m *MockMasterServer) GetSubTaskCfg(arg0 context.Context, arg1 *pb.GetSubTaskCfgRequest) (*pb.GetSubTaskCfgResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSubTaskCfg", arg0, arg1) @@ -512,13 +533,13 @@ func (m *MockMasterServer) GetSubTaskCfg(arg0 context.Context, arg1 *pb.GetSubTa return ret0, ret1 } -// GetSubTaskCfg indicates an expected call of GetSubTaskCfg +// GetSubTaskCfg indicates an expected call of GetSubTaskCfg. func (mr *MockMasterServerMockRecorder) GetSubTaskCfg(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubTaskCfg", reflect.TypeOf((*MockMasterServer)(nil).GetSubTaskCfg), arg0, arg1) } -// HandleError mocks base method +// HandleError mocks base method. func (m *MockMasterServer) HandleError(arg0 context.Context, arg1 *pb.HandleErrorRequest) (*pb.HandleErrorResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HandleError", arg0, arg1) @@ -527,13 +548,13 @@ func (m *MockMasterServer) HandleError(arg0 context.Context, arg1 *pb.HandleErro return ret0, ret1 } -// HandleError indicates an expected call of HandleError +// HandleError indicates an expected call of HandleError. func (mr *MockMasterServerMockRecorder) HandleError(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleError", reflect.TypeOf((*MockMasterServer)(nil).HandleError), arg0, arg1) } -// ListMember mocks base method +// ListMember mocks base method. func (m *MockMasterServer) ListMember(arg0 context.Context, arg1 *pb.ListMemberRequest) (*pb.ListMemberResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ListMember", arg0, arg1) @@ -542,13 +563,13 @@ func (m *MockMasterServer) ListMember(arg0 context.Context, arg1 *pb.ListMemberR return ret0, ret1 } -// ListMember indicates an expected call of ListMember +// ListMember indicates an expected call of ListMember. func (mr *MockMasterServerMockRecorder) ListMember(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListMember", reflect.TypeOf((*MockMasterServer)(nil).ListMember), arg0, arg1) } -// OfflineMember mocks base method +// OfflineMember mocks base method. func (m *MockMasterServer) OfflineMember(arg0 context.Context, arg1 *pb.OfflineMemberRequest) (*pb.OfflineMemberResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OfflineMember", arg0, arg1) @@ -557,13 +578,13 @@ func (m *MockMasterServer) OfflineMember(arg0 context.Context, arg1 *pb.OfflineM return ret0, ret1 } -// OfflineMember indicates an expected call of OfflineMember +// OfflineMember indicates an expected call of OfflineMember. func (mr *MockMasterServerMockRecorder) OfflineMember(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OfflineMember", reflect.TypeOf((*MockMasterServer)(nil).OfflineMember), arg0, arg1) } -// OperateLeader mocks base method +// OperateLeader mocks base method. func (m *MockMasterServer) OperateLeader(arg0 context.Context, arg1 *pb.OperateLeaderRequest) (*pb.OperateLeaderResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OperateLeader", arg0, arg1) @@ -572,13 +593,28 @@ func (m *MockMasterServer) OperateLeader(arg0 context.Context, arg1 *pb.OperateL return ret0, ret1 } -// OperateLeader indicates an expected call of OperateLeader +// OperateLeader indicates an expected call of OperateLeader. func (mr *MockMasterServerMockRecorder) OperateLeader(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateLeader", reflect.TypeOf((*MockMasterServer)(nil).OperateLeader), arg0, arg1) } -// OperateSchema mocks base method +// OperateRelay mocks base method. +func (m *MockMasterServer) OperateRelay(arg0 context.Context, arg1 *pb.OperateRelayRequest) (*pb.OperateRelayResponse, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "OperateRelay", arg0, arg1) + ret0, _ := ret[0].(*pb.OperateRelayResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// OperateRelay indicates an expected call of OperateRelay. +func (mr *MockMasterServerMockRecorder) OperateRelay(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateRelay", reflect.TypeOf((*MockMasterServer)(nil).OperateRelay), arg0, arg1) +} + +// OperateSchema mocks base method. func (m *MockMasterServer) OperateSchema(arg0 context.Context, arg1 *pb.OperateSchemaRequest) (*pb.OperateSchemaResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OperateSchema", arg0, arg1) @@ -587,13 +623,13 @@ func (m *MockMasterServer) OperateSchema(arg0 context.Context, arg1 *pb.OperateS return ret0, ret1 } -// OperateSchema indicates an expected call of OperateSchema +// OperateSchema indicates an expected call of OperateSchema. func (mr *MockMasterServerMockRecorder) OperateSchema(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateSchema", reflect.TypeOf((*MockMasterServer)(nil).OperateSchema), arg0, arg1) } -// OperateSource mocks base method +// OperateSource mocks base method. func (m *MockMasterServer) OperateSource(arg0 context.Context, arg1 *pb.OperateSourceRequest) (*pb.OperateSourceResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OperateSource", arg0, arg1) @@ -602,13 +638,13 @@ func (m *MockMasterServer) OperateSource(arg0 context.Context, arg1 *pb.OperateS return ret0, ret1 } -// OperateSource indicates an expected call of OperateSource +// OperateSource indicates an expected call of OperateSource. func (mr *MockMasterServerMockRecorder) OperateSource(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateSource", reflect.TypeOf((*MockMasterServer)(nil).OperateSource), arg0, arg1) } -// OperateTask mocks base method +// OperateTask mocks base method. func (m *MockMasterServer) OperateTask(arg0 context.Context, arg1 *pb.OperateTaskRequest) (*pb.OperateTaskResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OperateTask", arg0, arg1) @@ -617,13 +653,13 @@ func (m *MockMasterServer) OperateTask(arg0 context.Context, arg1 *pb.OperateTas return ret0, ret1 } -// OperateTask indicates an expected call of OperateTask +// OperateTask indicates an expected call of OperateTask. func (mr *MockMasterServerMockRecorder) OperateTask(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateTask", reflect.TypeOf((*MockMasterServer)(nil).OperateTask), arg0, arg1) } -// OperateWorkerRelayTask mocks base method +// OperateWorkerRelayTask mocks base method. func (m *MockMasterServer) OperateWorkerRelayTask(arg0 context.Context, arg1 *pb.OperateWorkerRelayRequest) (*pb.OperateWorkerRelayResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OperateWorkerRelayTask", arg0, arg1) @@ -632,13 +668,13 @@ func (m *MockMasterServer) OperateWorkerRelayTask(arg0 context.Context, arg1 *pb return ret0, ret1 } -// OperateWorkerRelayTask indicates an expected call of OperateWorkerRelayTask +// OperateWorkerRelayTask indicates an expected call of OperateWorkerRelayTask. func (mr *MockMasterServerMockRecorder) OperateWorkerRelayTask(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateWorkerRelayTask", reflect.TypeOf((*MockMasterServer)(nil).OperateWorkerRelayTask), arg0, arg1) } -// PurgeWorkerRelay mocks base method +// PurgeWorkerRelay mocks base method. func (m *MockMasterServer) PurgeWorkerRelay(arg0 context.Context, arg1 *pb.PurgeWorkerRelayRequest) (*pb.PurgeWorkerRelayResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PurgeWorkerRelay", arg0, arg1) @@ -647,13 +683,13 @@ func (m *MockMasterServer) PurgeWorkerRelay(arg0 context.Context, arg1 *pb.Purge return ret0, ret1 } -// PurgeWorkerRelay indicates an expected call of PurgeWorkerRelay +// PurgeWorkerRelay indicates an expected call of PurgeWorkerRelay. func (mr *MockMasterServerMockRecorder) PurgeWorkerRelay(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PurgeWorkerRelay", reflect.TypeOf((*MockMasterServer)(nil).PurgeWorkerRelay), arg0, arg1) } -// QueryStatus mocks base method +// QueryStatus mocks base method. func (m *MockMasterServer) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatusListRequest) (*pb.QueryStatusListResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "QueryStatus", arg0, arg1) @@ -662,13 +698,13 @@ func (m *MockMasterServer) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatu return ret0, ret1 } -// QueryStatus indicates an expected call of QueryStatus +// QueryStatus indicates an expected call of QueryStatus. func (mr *MockMasterServerMockRecorder) QueryStatus(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryStatus", reflect.TypeOf((*MockMasterServer)(nil).QueryStatus), arg0, arg1) } -// RegisterWorker mocks base method +// RegisterWorker mocks base method. func (m *MockMasterServer) RegisterWorker(arg0 context.Context, arg1 *pb.RegisterWorkerRequest) (*pb.RegisterWorkerResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "RegisterWorker", arg0, arg1) @@ -677,13 +713,13 @@ func (m *MockMasterServer) RegisterWorker(arg0 context.Context, arg1 *pb.Registe return ret0, ret1 } -// RegisterWorker indicates an expected call of RegisterWorker +// RegisterWorker indicates an expected call of RegisterWorker. func (mr *MockMasterServerMockRecorder) RegisterWorker(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegisterWorker", reflect.TypeOf((*MockMasterServer)(nil).RegisterWorker), arg0, arg1) } -// ShowDDLLocks mocks base method +// ShowDDLLocks mocks base method. func (m *MockMasterServer) ShowDDLLocks(arg0 context.Context, arg1 *pb.ShowDDLLocksRequest) (*pb.ShowDDLLocksResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ShowDDLLocks", arg0, arg1) @@ -692,13 +728,13 @@ func (m *MockMasterServer) ShowDDLLocks(arg0 context.Context, arg1 *pb.ShowDDLLo return ret0, ret1 } -// ShowDDLLocks indicates an expected call of ShowDDLLocks +// ShowDDLLocks indicates an expected call of ShowDDLLocks. func (mr *MockMasterServerMockRecorder) ShowDDLLocks(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ShowDDLLocks", reflect.TypeOf((*MockMasterServer)(nil).ShowDDLLocks), arg0, arg1) } -// StartTask mocks base method +// StartTask mocks base method. func (m *MockMasterServer) StartTask(arg0 context.Context, arg1 *pb.StartTaskRequest) (*pb.StartTaskResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "StartTask", arg0, arg1) @@ -707,13 +743,13 @@ func (m *MockMasterServer) StartTask(arg0 context.Context, arg1 *pb.StartTaskReq return ret0, ret1 } -// StartTask indicates an expected call of StartTask +// StartTask indicates an expected call of StartTask. func (mr *MockMasterServerMockRecorder) StartTask(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "StartTask", reflect.TypeOf((*MockMasterServer)(nil).StartTask), arg0, arg1) } -// TransferSource mocks base method +// TransferSource mocks base method. func (m *MockMasterServer) TransferSource(arg0 context.Context, arg1 *pb.TransferSourceRequest) (*pb.TransferSourceResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "TransferSource", arg0, arg1) @@ -722,13 +758,13 @@ func (m *MockMasterServer) TransferSource(arg0 context.Context, arg1 *pb.Transfe return ret0, ret1 } -// TransferSource indicates an expected call of TransferSource +// TransferSource indicates an expected call of TransferSource. func (mr *MockMasterServerMockRecorder) TransferSource(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "TransferSource", reflect.TypeOf((*MockMasterServer)(nil).TransferSource), arg0, arg1) } -// UnlockDDLLock mocks base method +// UnlockDDLLock mocks base method. func (m *MockMasterServer) UnlockDDLLock(arg0 context.Context, arg1 *pb.UnlockDDLLockRequest) (*pb.UnlockDDLLockResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UnlockDDLLock", arg0, arg1) @@ -737,13 +773,13 @@ func (m *MockMasterServer) UnlockDDLLock(arg0 context.Context, arg1 *pb.UnlockDD return ret0, ret1 } -// UnlockDDLLock indicates an expected call of UnlockDDLLock +// UnlockDDLLock indicates an expected call of UnlockDDLLock. func (mr *MockMasterServerMockRecorder) UnlockDDLLock(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnlockDDLLock", reflect.TypeOf((*MockMasterServer)(nil).UnlockDDLLock), arg0, arg1) } -// UpdateTask mocks base method +// UpdateTask mocks base method. func (m *MockMasterServer) UpdateTask(arg0 context.Context, arg1 *pb.UpdateTaskRequest) (*pb.UpdateTaskResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UpdateTask", arg0, arg1) @@ -752,7 +788,7 @@ func (m *MockMasterServer) UpdateTask(arg0 context.Context, arg1 *pb.UpdateTaskR return ret0, ret1 } -// UpdateTask indicates an expected call of UpdateTask +// UpdateTask indicates an expected call of UpdateTask. func (mr *MockMasterServerMockRecorder) UpdateTask(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateTask", reflect.TypeOf((*MockMasterServer)(nil).UpdateTask), arg0, arg1) diff --git a/dm/pbmock/dmworker.go b/dm/pbmock/dmworker.go index fa4f3de7a3..a7601b37b9 100644 --- a/dm/pbmock/dmworker.go +++ b/dm/pbmock/dmworker.go @@ -6,36 +6,37 @@ package pbmock import ( context "context" + reflect "reflect" + gomock "github.com/golang/mock/gomock" pb "github.com/pingcap/dm/dm/pb" grpc "google.golang.org/grpc" - reflect "reflect" ) -// MockWorkerClient is a mock of WorkerClient interface +// MockWorkerClient is a mock of WorkerClient interface. type MockWorkerClient struct { ctrl *gomock.Controller recorder *MockWorkerClientMockRecorder } -// MockWorkerClientMockRecorder is the mock recorder for MockWorkerClient +// MockWorkerClientMockRecorder is the mock recorder for MockWorkerClient. type MockWorkerClientMockRecorder struct { mock *MockWorkerClient } -// NewMockWorkerClient creates a new mock instance +// NewMockWorkerClient creates a new mock instance. func NewMockWorkerClient(ctrl *gomock.Controller) *MockWorkerClient { mock := &MockWorkerClient{ctrl: ctrl} mock.recorder = &MockWorkerClientMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockWorkerClient) EXPECT() *MockWorkerClientMockRecorder { return m.recorder } -// GetWorkerCfg mocks base method +// GetWorkerCfg mocks base method. func (m *MockWorkerClient) GetWorkerCfg(arg0 context.Context, arg1 *pb.GetWorkerCfgRequest, arg2 ...grpc.CallOption) (*pb.GetWorkerCfgResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -48,14 +49,14 @@ func (m *MockWorkerClient) GetWorkerCfg(arg0 context.Context, arg1 *pb.GetWorker return ret0, ret1 } -// GetWorkerCfg indicates an expected call of GetWorkerCfg +// GetWorkerCfg indicates an expected call of GetWorkerCfg. func (mr *MockWorkerClientMockRecorder) GetWorkerCfg(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkerCfg", reflect.TypeOf((*MockWorkerClient)(nil).GetWorkerCfg), varargs...) } -// HandleError mocks base method +// HandleError mocks base method. func (m *MockWorkerClient) HandleError(arg0 context.Context, arg1 *pb.HandleWorkerErrorRequest, arg2 ...grpc.CallOption) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -68,14 +69,14 @@ func (m *MockWorkerClient) HandleError(arg0 context.Context, arg1 *pb.HandleWork return ret0, ret1 } -// HandleError indicates an expected call of HandleError +// HandleError indicates an expected call of HandleError. func (mr *MockWorkerClientMockRecorder) HandleError(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleError", reflect.TypeOf((*MockWorkerClient)(nil).HandleError), varargs...) } -// OperateSchema mocks base method +// OperateSchema mocks base method. func (m *MockWorkerClient) OperateSchema(arg0 context.Context, arg1 *pb.OperateWorkerSchemaRequest, arg2 ...grpc.CallOption) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -88,14 +89,14 @@ func (m *MockWorkerClient) OperateSchema(arg0 context.Context, arg1 *pb.OperateW return ret0, ret1 } -// OperateSchema indicates an expected call of OperateSchema +// OperateSchema indicates an expected call of OperateSchema. func (mr *MockWorkerClientMockRecorder) OperateSchema(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateSchema", reflect.TypeOf((*MockWorkerClient)(nil).OperateSchema), varargs...) } -// OperateV1Meta mocks base method +// OperateV1Meta mocks base method. func (m *MockWorkerClient) OperateV1Meta(arg0 context.Context, arg1 *pb.OperateV1MetaRequest, arg2 ...grpc.CallOption) (*pb.OperateV1MetaResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -108,14 +109,14 @@ func (m *MockWorkerClient) OperateV1Meta(arg0 context.Context, arg1 *pb.OperateV return ret0, ret1 } -// OperateV1Meta indicates an expected call of OperateV1Meta +// OperateV1Meta indicates an expected call of OperateV1Meta. func (mr *MockWorkerClientMockRecorder) OperateV1Meta(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateV1Meta", reflect.TypeOf((*MockWorkerClient)(nil).OperateV1Meta), varargs...) } -// PurgeRelay mocks base method +// PurgeRelay mocks base method. func (m *MockWorkerClient) PurgeRelay(arg0 context.Context, arg1 *pb.PurgeRelayRequest, arg2 ...grpc.CallOption) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -128,14 +129,14 @@ func (m *MockWorkerClient) PurgeRelay(arg0 context.Context, arg1 *pb.PurgeRelayR return ret0, ret1 } -// PurgeRelay indicates an expected call of PurgeRelay +// PurgeRelay indicates an expected call of PurgeRelay. func (mr *MockWorkerClientMockRecorder) PurgeRelay(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PurgeRelay", reflect.TypeOf((*MockWorkerClient)(nil).PurgeRelay), varargs...) } -// QueryStatus mocks base method +// QueryStatus mocks base method. func (m *MockWorkerClient) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatusRequest, arg2 ...grpc.CallOption) (*pb.QueryStatusResponse, error) { m.ctrl.T.Helper() varargs := []interface{}{arg0, arg1} @@ -148,37 +149,37 @@ func (m *MockWorkerClient) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatu return ret0, ret1 } -// QueryStatus indicates an expected call of QueryStatus +// QueryStatus indicates an expected call of QueryStatus. func (mr *MockWorkerClientMockRecorder) QueryStatus(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() varargs := append([]interface{}{arg0, arg1}, arg2...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryStatus", reflect.TypeOf((*MockWorkerClient)(nil).QueryStatus), varargs...) } -// MockWorkerServer is a mock of WorkerServer interface +// MockWorkerServer is a mock of WorkerServer interface. type MockWorkerServer struct { ctrl *gomock.Controller recorder *MockWorkerServerMockRecorder } -// MockWorkerServerMockRecorder is the mock recorder for MockWorkerServer +// MockWorkerServerMockRecorder is the mock recorder for MockWorkerServer. type MockWorkerServerMockRecorder struct { mock *MockWorkerServer } -// NewMockWorkerServer creates a new mock instance +// NewMockWorkerServer creates a new mock instance. func NewMockWorkerServer(ctrl *gomock.Controller) *MockWorkerServer { mock := &MockWorkerServer{ctrl: ctrl} mock.recorder = &MockWorkerServerMockRecorder{mock} return mock } -// EXPECT returns an object that allows the caller to indicate expected use +// EXPECT returns an object that allows the caller to indicate expected use. func (m *MockWorkerServer) EXPECT() *MockWorkerServerMockRecorder { return m.recorder } -// GetWorkerCfg mocks base method +// GetWorkerCfg mocks base method. func (m *MockWorkerServer) GetWorkerCfg(arg0 context.Context, arg1 *pb.GetWorkerCfgRequest) (*pb.GetWorkerCfgResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetWorkerCfg", arg0, arg1) @@ -187,13 +188,13 @@ func (m *MockWorkerServer) GetWorkerCfg(arg0 context.Context, arg1 *pb.GetWorker return ret0, ret1 } -// GetWorkerCfg indicates an expected call of GetWorkerCfg +// GetWorkerCfg indicates an expected call of GetWorkerCfg. func (mr *MockWorkerServerMockRecorder) GetWorkerCfg(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetWorkerCfg", reflect.TypeOf((*MockWorkerServer)(nil).GetWorkerCfg), arg0, arg1) } -// HandleError mocks base method +// HandleError mocks base method. func (m *MockWorkerServer) HandleError(arg0 context.Context, arg1 *pb.HandleWorkerErrorRequest) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "HandleError", arg0, arg1) @@ -202,13 +203,13 @@ func (m *MockWorkerServer) HandleError(arg0 context.Context, arg1 *pb.HandleWork return ret0, ret1 } -// HandleError indicates an expected call of HandleError +// HandleError indicates an expected call of HandleError. func (mr *MockWorkerServerMockRecorder) HandleError(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleError", reflect.TypeOf((*MockWorkerServer)(nil).HandleError), arg0, arg1) } -// OperateSchema mocks base method +// OperateSchema mocks base method. func (m *MockWorkerServer) OperateSchema(arg0 context.Context, arg1 *pb.OperateWorkerSchemaRequest) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OperateSchema", arg0, arg1) @@ -217,13 +218,13 @@ func (m *MockWorkerServer) OperateSchema(arg0 context.Context, arg1 *pb.OperateW return ret0, ret1 } -// OperateSchema indicates an expected call of OperateSchema +// OperateSchema indicates an expected call of OperateSchema. func (mr *MockWorkerServerMockRecorder) OperateSchema(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateSchema", reflect.TypeOf((*MockWorkerServer)(nil).OperateSchema), arg0, arg1) } -// OperateV1Meta mocks base method +// OperateV1Meta mocks base method. func (m *MockWorkerServer) OperateV1Meta(arg0 context.Context, arg1 *pb.OperateV1MetaRequest) (*pb.OperateV1MetaResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "OperateV1Meta", arg0, arg1) @@ -232,13 +233,13 @@ func (m *MockWorkerServer) OperateV1Meta(arg0 context.Context, arg1 *pb.OperateV return ret0, ret1 } -// OperateV1Meta indicates an expected call of OperateV1Meta +// OperateV1Meta indicates an expected call of OperateV1Meta. func (mr *MockWorkerServerMockRecorder) OperateV1Meta(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "OperateV1Meta", reflect.TypeOf((*MockWorkerServer)(nil).OperateV1Meta), arg0, arg1) } -// PurgeRelay mocks base method +// PurgeRelay mocks base method. func (m *MockWorkerServer) PurgeRelay(arg0 context.Context, arg1 *pb.PurgeRelayRequest) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "PurgeRelay", arg0, arg1) @@ -247,13 +248,13 @@ func (m *MockWorkerServer) PurgeRelay(arg0 context.Context, arg1 *pb.PurgeRelayR return ret0, ret1 } -// PurgeRelay indicates an expected call of PurgeRelay +// PurgeRelay indicates an expected call of PurgeRelay. func (mr *MockWorkerServerMockRecorder) PurgeRelay(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "PurgeRelay", reflect.TypeOf((*MockWorkerServer)(nil).PurgeRelay), arg0, arg1) } -// QueryStatus mocks base method +// QueryStatus mocks base method. func (m *MockWorkerServer) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatusRequest) (*pb.QueryStatusResponse, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "QueryStatus", arg0, arg1) @@ -262,7 +263,7 @@ func (m *MockWorkerServer) QueryStatus(arg0 context.Context, arg1 *pb.QueryStatu return ret0, ret1 } -// QueryStatus indicates an expected call of QueryStatus +// QueryStatus indicates an expected call of QueryStatus. func (mr *MockWorkerServerMockRecorder) QueryStatus(arg0, arg1 interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryStatus", reflect.TypeOf((*MockWorkerServer)(nil).QueryStatus), arg0, arg1) diff --git a/dm/proto/dmmaster.proto b/dm/proto/dmmaster.proto index 84f3df286e..9f4a7e2b02 100644 --- a/dm/proto/dmmaster.proto +++ b/dm/proto/dmmaster.proto @@ -249,6 +249,8 @@ message PurgeWorkerRelayResponse { message CheckTaskRequest { string task = 1; // task's configuration, yaml format + int64 errCnt = 2; // max error count to display + int64 warnCnt = 3; // max warn count to display } message CheckTaskResponse { diff --git a/tests/dmctl_basic/check_list/check_task.sh b/tests/dmctl_basic/check_list/check_task.sh index c503470d37..9d9d48d114 100644 --- a/tests/dmctl_basic/check_list/check_task.sh +++ b/tests/dmctl_basic/check_list/check_task.sh @@ -3,7 +3,7 @@ function check_task_wrong_arg() { run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ "check-task" \ - "check-task \[flags\]" 1 + "check-task \[--error count\] \[--warn count\] \[flags\]" 1 } function check_task_wrong_config_file() { @@ -34,3 +34,33 @@ function check_task_error_database_config() { "Access denied for user" 1 \ "Please check the database connection and the database config in configuration file" 1 } + +function check_task_error_count() { + # 10 errors + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "check-task $cur/conf/dm-task3.yaml" \ + "\"result\": false" 1 \ + "\"failed\": 2" 1 \ + "\"state\": \"fail\"" 2 + + # 1 error + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "check-task $cur/conf/dm-task3.yaml -e 1" \ + "\"result\": false" 1 \ + "\"failed\": 2" 1 \ + "\"state\": \"fail\"" 1 + + # 100 errors + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "check-task $cur/conf/dm-task3.yaml -e 100 -w 1" \ + "\"result\": false" 1 \ + "\"failed\": 2" 1 \ + "\"state\": \"fail\"" 2 + + # 0 error + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "check-task $cur/conf/dm-task3.yaml -e 0" \ + "\"result\": false" 1 \ + "\"failed\": 2" 1 \ + "\"state\": \"fail\"" 0 +} diff --git a/tests/dmctl_basic/conf/dm-task3.yaml b/tests/dmctl_basic/conf/dm-task3.yaml new file mode 100644 index 0000000000..13a759e3f4 --- /dev/null +++ b/tests/dmctl_basic/conf/dm-task3.yaml @@ -0,0 +1,64 @@ +--- +name: pre_check +task-mode: all +is-sharding: true +meta-schema: "dm_meta" +enable-heartbeat: false +timezone: "Asia/Shanghai" + +target-database: + host: "127.0.0.1" + port: 4000 + user: "root" + password: "" + +mysql-instances: + - source-id: "mysql-replica-01" + block-allow-list: "instance" + route-rules: ["sharding-route-rules-table", "sharding-route-rules-schema"] + mydumper-config-name: "global" + loader-config-name: "global" + syncer-config-name: "global" + + - source-id: "mysql-replica-02" + block-allow-list: "instance" + route-rules: ["sharding-route-rules-table", "sharding-route-rules-schema"] + mydumper-config-name: "global" + loader-config-name: "global" + syncer-config-name: "global" + +block-allow-list: + instance: + do-dbs: ["dmctl"] + do-tables: + - db-name: "dmctl" + tbl-name: "~^tb_[\\d]+" + +routes: + sharding-route-rules-table: + schema-pattern: dmctl + table-pattern: tb_* + target-schema: dmctl + target-table: tb + + sharding-route-rules-schema: + schema-pattern: dmctl + target-schema: dmctl + +mydumpers: + global: + threads: 4 + chunk-filesize: 64 + skip-tz-utc: true + extra-args: "" + +loaders: + global: + pool-size: 16 + dir: "./dumped_data" + +syncers: + global: + worker-count: 16 + batch: 100 + checkpoint-flush-interval: 1 diff --git a/tests/dmctl_basic/data/db1.prepare.sql b/tests/dmctl_basic/data/db1.prepare.sql index 7340744445..f4e971c9eb 100644 --- a/tests/dmctl_basic/data/db1.prepare.sql +++ b/tests/dmctl_basic/data/db1.prepare.sql @@ -22,3 +22,6 @@ INSERT INTO `dmctl`.`t_2` (`b`,`c`,`d`,`id`) VALUES (1758036092,'CxSfGQNebY','OY INSERT INTO `dmctl`.`t_1` (`b`,`c`,`d`,`id`) VALUES (1649664004,'eIXDUjODpLjRkXu','NWlGjQq',7); INSERT INTO `dmctl`.`t_1` (`b`,`c`,`d`,`id`) VALUES (1402446429,'xQMCGsfckXpoe','R',8); INSERT INTO `dmctl`.`t_1` (`b`,`c`,`d`,`id`) VALUES (800180420,'JuUIxUacksp','sX',9); + +create table tb_1(a INT, b INT); +create table tb_2(a INT, c INT); diff --git a/tests/dmctl_basic/run.sh b/tests/dmctl_basic/run.sh index 60982a6d93..26f1de360c 100755 --- a/tests/dmctl_basic/run.sh +++ b/tests/dmctl_basic/run.sh @@ -192,6 +192,7 @@ function run() { echo "dmctl_check_task" check_task_pass $TASK_CONF check_task_not_pass $cur/conf/dm-task2.yaml + check_task_error_count $cur/conf/dm-task3.yaml cp $cur/conf/dm-task.yaml $WORK_DIR/dm-task-error-database-config.yaml sed -i "s/password: \"\"/password: \"wrond password\"/g" $WORK_DIR/dm-task-error-database-config.yaml diff --git a/tools/go.mod b/tools/go.mod index ca836649e3..025b5d0254 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -3,10 +3,10 @@ module github.com/pingcap/dm/tools go 1.13 require ( - github.com/gogo/protobuf v1.3.2 + github.com/gogo/protobuf v1.3.1 github.com/golang/mock v1.5.0 github.com/golangci/golangci-lint v1.39.0 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 + github.com/grpc-ecosystem/grpc-gateway v1.12.1 github.com/mattn/goveralls v0.0.8 github.com/pingcap/failpoint v0.0.0-20210316064728-7acb0f0a3dfd github.com/rakyll/statik v0.1.7 diff --git a/tools/go.sum b/tools/go.sum index f52cec0a96..257176e1b8 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -59,7 +59,6 @@ github.com/alexkohler/prealloc v1.0.0 h1:Hbq0/3fJPQhNkN0dR95AVrr6R7tou91y0uHG5pO github.com/alexkohler/prealloc v1.0.0/go.mod h1:VetnK3dIgFBBKmg0YnD9F9x6Icjd+9cvfHR56wJVlKE= github.com/andybalholm/brotli v1.0.0/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= github.com/antihax/optional v0.0.0-20180407024304-ca021399b1a6/go.mod h1:V8iCPQYkqmusNa815XgQio277wI47sdRh1dUOLdyC6Q= -github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -182,9 +181,8 @@ github.com/gofrs/flock v0.8.0/go.mod h1:F1TvTiK9OcQqauNUHlbJvyl9Qa1QvF/gOUDKA14j github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.3.0/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -263,7 +261,6 @@ github.com/google/trillian v1.3.11/go.mod h1:0tPraVHrSDkA3BO6vKX67zgLXs6SsOAbHEi github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= github.com/gookit/color v1.3.8/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= @@ -296,9 +293,8 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.2.2/go.mod h1:EaizFBKfUKtMIF5iaD github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= +github.com/grpc-ecosystem/grpc-gateway v1.12.1 h1:zCy2xE9ablevUOrUZc3Dl72Dt+ya2FNAvC2yLYMHzi4= github.com/grpc-ecosystem/grpc-gateway v1.12.1/go.mod h1:8XEsbTttt/W+VvjtQhLACqCisSPWTxCZ7sBRjU6iH9c= -github.com/grpc-ecosystem/grpc-gateway v1.16.0 h1:gmcG1KaJ57LophUzW0Hy8NmPhnMZb4M0+kPpLofRdBo= -github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= @@ -358,7 +354,6 @@ github.com/julz/importas v0.0.0-20210228071311-d0bf5cb4e1db/go.mod h1:oSFU2R4XK/ github.com/k0kubun/colorstring v0.0.0-20150214042306-9440f1994b88/go.mod h1:3w7q1U84EfirKl04SVQ/s7nPm1ZPhiXd34z40TNz36k= github.com/kisielk/errcheck v1.1.0/go.mod h1:EZBBE59ingxPouuu3KfxchcWSUPOHkagtvWXihfKN4Q= github.com/kisielk/errcheck v1.2.0/go.mod h1:/BMXB+zMLi60iA8Vv6Ksmxu/1UDYcXs4uQLJ+jE2L00= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/errcheck v1.6.0 h1:YTDO4pNy7AUN/021p+JGHycQyYNIyMoenM1YDVK6RlY= github.com/kisielk/errcheck v1.6.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0 h1:AV2c/EiW3KqPNT9ZKl07ehoAGi4C5/01Cfbblndcapg= @@ -923,7 +918,6 @@ golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.0.0-20201230224404-63754364767c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210101214203-2dba1e4ea05c/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210104081019-d8d6ddbec6ee/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.0 h1:po9/4sTYwZU9lPhi1tOrb4hCv3qrhiQ77LZfGa2OjwY= golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -981,7 +975,6 @@ google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20200626011028-ee7919e894b5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= @@ -1001,7 +994,6 @@ google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.0/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=