From 38aae74a08041698fab1a3d9ee9fb62105f19672 Mon Sep 17 00:00:00 2001 From: GMHDBJD <35025882+GMHDBJD@users.noreply.github.com> Date: Fri, 18 Dec 2020 16:04:56 +0800 Subject: [PATCH] cherry pick #1323 to release-2.0 Signed-off-by: ti-srebot --- chaos/cases/task.go | 6 + cmd/dm-ctl/main.go | 20 + dm/config/task.go | 73 +- dm/config/task_test.go | 71 +- dm/ctl/ctl.go | 2 +- .../{get_task_config.go => get_config.go} | 49 +- dm/master/bootstrap.go | 12 - dm/master/config.go | 35 +- dm/master/scheduler/scheduler.go | 149 ---- dm/master/server.go | 161 +++- dm/master/server_test.go | 63 +- dm/master/workerrpc/interface.go | 3 + dm/master/workerrpc/rawgrpc.go | 2 + dm/pb/dmmaster.pb.go | 770 +++++++++++++----- dm/pb/dmmaster.pb.gw.go | 43 +- dm/pb/dmworker.pb.go | 458 +++++++++++ dm/pbmock/dmmaster.go | 91 ++- dm/pbmock/dmworker.go | 35 + dm/proto/dmmaster.proto | 29 +- dm/proto/dmworker.proto | 9 + dm/worker/config.go | 2 +- dm/worker/relay.go | 3 +- dm/worker/server.go | 10 + pkg/ha/task.go | 88 -- pkg/ha/task_test.go | 114 --- tests/dmctl_basic/check_list/get_config.sh | 125 +++ .../dmctl_basic/check_list/get_task_config.sh | 44 - tests/dmctl_basic/conf/dm-master.toml | 1 + tests/dmctl_basic/conf/get_master1.toml | 21 + tests/dmctl_basic/conf/get_source1.yaml | 32 + tests/dmctl_basic/conf/get_source2.yaml | 32 + tests/dmctl_basic/conf/get_task.yaml | 135 +++ tests/dmctl_basic/conf/get_worker1.toml | 13 + tests/dmctl_basic/conf/get_worker2.toml | 13 + tests/dmctl_basic/conf/source1.yaml | 2 +- tests/dmctl_basic/conf/source2.yaml | 2 +- tests/dmctl_basic/run.sh | 7 +- tests/ha_master/run.sh | 8 + tests/http_apis/run.sh | 4 - tests/import_v10x/conf/task.yaml | 24 +- tests/import_v10x/run.sh | 3 +- 41 files changed, 1974 insertions(+), 790 deletions(-) rename dm/ctl/master/{get_task_config.go => get_config.go} (59%) delete mode 100644 pkg/ha/task.go delete mode 100644 pkg/ha/task_test.go create mode 100644 tests/dmctl_basic/check_list/get_config.sh delete mode 100644 tests/dmctl_basic/check_list/get_task_config.sh create mode 100644 tests/dmctl_basic/conf/get_master1.toml create mode 100644 tests/dmctl_basic/conf/get_source1.yaml create mode 100644 tests/dmctl_basic/conf/get_source2.yaml create mode 100644 tests/dmctl_basic/conf/get_task.yaml create mode 100644 tests/dmctl_basic/conf/get_worker1.toml create mode 100644 tests/dmctl_basic/conf/get_worker2.toml diff --git a/chaos/cases/task.go b/chaos/cases/task.go index 519815b68e..959956d673 100644 --- a/chaos/cases/task.go +++ b/chaos/cases/task.go @@ -23,6 +23,7 @@ import ( "github.com/chaos-mesh/go-sqlsmith" "github.com/pingcap/errors" + "github.com/pingcap/parser/mysql" "go.uber.org/zap" "golang.org/x/sync/errgroup" @@ -30,6 +31,7 @@ import ( "github.com/pingcap/dm/dm/pb" "github.com/pingcap/dm/pkg/conn" "github.com/pingcap/dm/pkg/log" + "github.com/pingcap/dm/pkg/utils" ) const ( @@ -356,6 +358,10 @@ func (t *task) genIncrData(ctx context.Context) (err error) { i2 := i eg.Go(func() error { if err2 := conn2.execSQLs(ctx, query); err2 != nil { + if utils.IsMySQLError(err2, mysql.ErrDupFieldName) { + t.logger.Warn("ignore duplicate field name for ddl", log.ShortError(err)) + return nil + } return err2 } t.results[i2].DDL++ diff --git a/cmd/dm-ctl/main.go b/cmd/dm-ctl/main.go index c52adb5818..b0603ba3d8 100644 --- a/cmd/dm-ctl/main.go +++ b/cmd/dm-ctl/main.go @@ -77,6 +77,8 @@ func main() { os.Exit(0) } + args = aliasArgs(args) + // now, we use checker in dmctl while it using some pkg which log some thing when running // to make dmctl output more clear, simply redirect log to file rather output to stdout err := log.InitLogger(&log.Config{ @@ -229,6 +231,7 @@ func loop() { } args := strings.Fields(line) + args = aliasArgs(args) err = ctl.Start(args) if err != nil { fmt.Println("fail to run:", args) @@ -240,3 +243,20 @@ func loop() { } } } + +func aliasArgs(args []string) []string { + args = aliasGetTaskCfgCmd(args) + return args +} + +func aliasGetTaskCfgCmd(args []string) []string { + for i, arg := range args { + if arg == "get-task-config" { + args = append(args[:i+1], args[i:]...) + args[i] = "get-config" + args[i+1] = "task" + return args + } + } + return args +} diff --git a/dm/config/task.go b/dm/config/task.go index c5bd7ca64d..9e4f3b97dc 100644 --- a/dm/config/task.go +++ b/dm/config/task.go @@ -160,19 +160,6 @@ func (m *MySQLInstance) VerifyAndAdjust() error { return nil } -// RemoveDuplicateCfg remove duplicate mydumper, loader, and syncer config -func (m *MySQLInstance) RemoveDuplicateCfg() { - if len(m.MydumperConfigName) > 0 && m.Mydumper != nil { - m.Mydumper = nil - } - if len(m.LoaderConfigName) > 0 && m.Loader != nil { - m.Loader = nil - } - if len(m.SyncerConfigName) > 0 && m.Syncer != nil { - m.Syncer = nil - } -} - // MydumperConfig represents mydumper process unit's specific config type MydumperConfig struct { MydumperPath string `yaml:"mydumper-path" toml:"mydumper-path" json:"mydumper-path"` // mydumper binary path @@ -628,9 +615,27 @@ func (c *TaskConfig) SubTaskConfigs(sources map[string]DBConfig) ([]*SubTaskConf return cfgs, nil } +// getGenerateName generates name by rule or gets name from nameMap +// if it's a new name, increase nameIdx +// otherwise return current nameIdx +func getGenerateName(rule interface{}, nameIdx int, namePrefix string, nameMap map[string]string) (string, int) { + // use json as key since no DeepEqual for rules now. + ruleByte, err := json.Marshal(rule) + if err != nil { + log.L().Error(fmt.Sprintf("marshal %s rule to json", namePrefix), log.ShortError(err)) + return fmt.Sprintf("%s-%02d", namePrefix, nameIdx), nameIdx + 1 + } else if val, ok := nameMap[string(ruleByte)]; ok { + return val, nameIdx + } else { + ruleName := fmt.Sprintf("%s-%02d", namePrefix, nameIdx+1) + nameMap[string(ruleByte)] = ruleName + return ruleName, nameIdx + 1 + } +} + // FromSubTaskConfigs constructs task configs from a list of valid subtask configs. -// this method is only used to construct config when importing from v1.0.x now. -func (c *TaskConfig) FromSubTaskConfigs(stCfgs ...*SubTaskConfig) { +func FromSubTaskConfigs(stCfgs ...*SubTaskConfig) *TaskConfig { + c := &TaskConfig{} // global configs. stCfg0 := stCfgs[0] c.Name = stCfg0.Name @@ -656,39 +661,48 @@ func (c *TaskConfig) FromSubTaskConfigs(stCfgs ...*SubTaskConfig) { c.Loaders = make(map[string]*LoaderConfig) c.Syncers = make(map[string]*SyncerConfig) + BAListMap := make(map[string]string, len(stCfgs)) + routeMap := make(map[string]string, len(stCfgs)) + filterMap := make(map[string]string, len(stCfgs)) + dumpMap := make(map[string]string, len(stCfgs)) + loadMap := make(map[string]string, len(stCfgs)) + syncMap := make(map[string]string, len(stCfgs)) + cmMap := make(map[string]string, len(stCfgs)) + var baListIdx, routeIdx, filterIdx, dumpIdx, loadIdx, syncIdx, cmIdx int + var baListName, routeName, filterName, dumpName, loadName, syncName, cmName string + // NOTE: // - we choose to ref global configs for instances now. - // - no DeepEqual for rules now, so not combine REAL same rule into only one. - for i, stCfg := range stCfgs { - BAListName := fmt.Sprintf("balist-%02d", i+1) - c.BAList[BAListName] = stCfg.BAList + for _, stCfg := range stCfgs { + baListName, baListIdx = getGenerateName(stCfg.BAList, baListIdx, "balist", BAListMap) + c.BAList[baListName] = stCfg.BAList routeNames := make([]string, 0, len(stCfg.RouteRules)) - for j, rule := range stCfg.RouteRules { - routeName := fmt.Sprintf("route-%02d-%02d", i+1, j+1) + for _, rule := range stCfg.RouteRules { + routeName, routeIdx = getGenerateName(rule, routeIdx, "route", routeMap) routeNames = append(routeNames, routeName) c.Routes[routeName] = rule } filterNames := make([]string, 0, len(stCfg.FilterRules)) - for j, rule := range stCfg.FilterRules { - filterName := fmt.Sprintf("filter-%02d-%02d", i+1, j+1) + for _, rule := range stCfg.FilterRules { + filterName, filterIdx = getGenerateName(rule, filterIdx, "filter", filterMap) filterNames = append(filterNames, filterName) c.Filters[filterName] = rule } - dumpName := fmt.Sprintf("dump-%02d", i+1) + dumpName, dumpIdx = getGenerateName(stCfg.MydumperConfig, dumpIdx, "dump", dumpMap) c.Mydumpers[dumpName] = &stCfg.MydumperConfig - loadName := fmt.Sprintf("load-%02d", i+1) + loadName, loadIdx = getGenerateName(stCfg.LoaderConfig, loadIdx, "load", loadMap) c.Loaders[loadName] = &stCfg.LoaderConfig - syncName := fmt.Sprintf("sync-%02d", i+1) + syncName, syncIdx = getGenerateName(stCfg.SyncerConfig, syncIdx, "sync", syncMap) c.Syncers[syncName] = &stCfg.SyncerConfig cmNames := make([]string, 0, len(stCfg.ColumnMappingRules)) - for j, rule := range stCfg.ColumnMappingRules { - cmName := fmt.Sprintf("cm-%02d-%02d", i+1, j+1) + for _, rule := range stCfg.ColumnMappingRules { + cmName, cmIdx = getGenerateName(rule, cmIdx, "cm", cmMap) cmNames = append(cmNames, cmName) c.ColumnMappings[cmName] = rule } @@ -699,12 +713,13 @@ func (c *TaskConfig) FromSubTaskConfigs(stCfgs ...*SubTaskConfig) { FilterRules: filterNames, ColumnMappingRules: cmNames, RouteRules: routeNames, - BAListName: BAListName, + BAListName: baListName, MydumperConfigName: dumpName, LoaderConfigName: loadName, SyncerConfigName: syncName, }) } + return c } // checkDuplicateString checks whether the given string array has duplicate string item diff --git a/dm/config/task_test.go b/dm/config/task_test.go index 05bf63ba56..98414bf3de 100644 --- a/dm/config/task_test.go +++ b/dm/config/task_test.go @@ -17,6 +17,7 @@ import ( "io/ioutil" "path" "sort" + "strings" . "github.com/pingcap/check" "github.com/pingcap/dm/pkg/terror" @@ -311,6 +312,16 @@ func (t *testConfig) TestTaskBlockAllowList(c *C) { c.Assert(cfg.BAList["source-1"], Equals, filterRules2) } +func WordCount(s string) map[string]int { + words := strings.Fields(s) + wordCount := make(map[string]int) + for i := range words { + wordCount[words[i]]++ + } + + return wordCount +} + func (t *testConfig) TestGenAndFromSubTaskConfigs(c *C) { var ( shardMode = ShardOptimistic @@ -352,6 +363,17 @@ func (t *testConfig) TestGenAndFromSubTaskConfigs(c *C) { TargetSchema: "db", TargetTable: "tbl", } + routeRule3 = router.TableRule{ + SchemaPattern: "database*", + TablePattern: "table*", + } + routeRule4 = router.TableRule{ + SchemaPattern: "schema*", + TablePattern: "tbs*", + TargetSchema: "schema", + TargetTable: "tbs", + } + filterRule1 = bf.BinlogEventRule{ SchemaPattern: "db*", TablePattern: "tbl1*", @@ -429,7 +451,7 @@ func (t *testConfig) TestGenAndFromSubTaskConfigs(c *C) { Security: &security, RawDBCfg: &rawDBCfg, }, - RouteRules: []*router.TableRule{&routeRule1, &routeRule2}, + RouteRules: []*router.TableRule{&routeRule2, &routeRule1, &routeRule3}, FilterRules: []*bf.BinlogEventRule{&filterRule1, &filterRule2}, BAList: &baList1, MydumperConfig: MydumperConfig{ @@ -472,9 +494,9 @@ func (t *testConfig) TestGenAndFromSubTaskConfigs(c *C) { } stCfg2.From = source2DBCfg stCfg2.BAList = &baList2 + stCfg2.RouteRules = []*router.TableRule{&routeRule4, &routeRule1, &routeRule2} - var cfg TaskConfig - cfg.FromSubTaskConfigs(stCfg1, stCfg2) + cfg := FromSubTaskConfigs(stCfg1, stCfg2) cfg2 := TaskConfig{ Name: name, @@ -493,9 +515,9 @@ func (t *testConfig) TestGenAndFromSubTaskConfigs(c *C) { { SourceID: source1, Meta: stCfg1.Meta, - FilterRules: []string{"filter-01-01", "filter-01-02"}, + FilterRules: []string{"filter-01", "filter-02"}, ColumnMappingRules: []string{}, - RouteRules: []string{"route-01-01", "route-01-02"}, + RouteRules: []string{"route-01", "route-02", "route-03"}, BWListName: "", BAListName: "balist-01", MydumperConfigName: "dump-01", @@ -511,57 +533,52 @@ func (t *testConfig) TestGenAndFromSubTaskConfigs(c *C) { { SourceID: source2, Meta: stCfg2.Meta, - FilterRules: []string{"filter-02-01", "filter-02-02"}, + FilterRules: []string{"filter-01", "filter-02"}, ColumnMappingRules: []string{}, - RouteRules: []string{"route-02-01", "route-02-02"}, + RouteRules: []string{"route-01", "route-02", "route-04"}, BWListName: "", BAListName: "balist-02", - MydumperConfigName: "dump-02", + MydumperConfigName: "dump-01", Mydumper: nil, MydumperThread: 0, - LoaderConfigName: "load-02", + LoaderConfigName: "load-01", Loader: nil, LoaderThread: 0, - SyncerConfigName: "sync-02", + SyncerConfigName: "sync-01", Syncer: nil, SyncerThread: 0, }, }, OnlineDDLScheme: onlineDDLScheme, Routes: map[string]*router.TableRule{ - "route-01-01": stCfg1.RouteRules[0], - "route-01-02": stCfg1.RouteRules[1], - "route-02-01": stCfg2.RouteRules[0], - "route-02-02": stCfg2.RouteRules[1], + "route-01": &routeRule1, + "route-02": &routeRule2, + "route-03": &routeRule3, + "route-04": &routeRule4, }, Filters: map[string]*bf.BinlogEventRule{ - "filter-01-01": stCfg1.FilterRules[0], - "filter-01-02": stCfg1.FilterRules[1], - "filter-02-01": stCfg2.FilterRules[0], - "filter-02-02": stCfg2.FilterRules[1], + "filter-01": &filterRule1, + "filter-02": &filterRule2, }, ColumnMappings: nil, BWList: nil, BAList: map[string]*filter.Rules{ - "balist-01": stCfg1.BAList, - "balist-02": stCfg2.BAList, + "balist-01": &baList1, + "balist-02": &baList2, }, Mydumpers: map[string]*MydumperConfig{ "dump-01": &stCfg1.MydumperConfig, - "dump-02": &stCfg2.MydumperConfig, }, Loaders: map[string]*LoaderConfig{ "load-01": &stCfg1.LoaderConfig, - "load-02": &stCfg2.LoaderConfig, }, Syncers: map[string]*SyncerConfig{ "sync-01": &stCfg1.SyncerConfig, - "sync-02": &stCfg2.SyncerConfig, }, CleanDumpFile: stCfg1.CleanDumpFile, } - c.Assert(cfg.String(), Equals, cfg2.String()) // some nil/(null value) compare may not equal, so use YAML format to compare. + c.Assert(WordCount(cfg.String()), DeepEquals, WordCount(cfg2.String())) // since rules are unordered, so use WordCount to compare c.Assert(cfg.adjust(), IsNil) stCfgs, err := cfg.SubTaskConfigs(map[string]DBConfig{source1: source1DBCfg, source2: source2DBCfg}) @@ -632,19 +649,19 @@ func (t *testConfig) TestMySQLInstance(c *C) { m.MydumperConfigName = "test" err = m.VerifyAndAdjust() c.Assert(terror.ErrConfigMydumperCfgConflict.Equal(err), IsTrue) - m.RemoveDuplicateCfg() + m.MydumperConfigName = "" m.Loader = &LoaderConfig{} m.LoaderConfigName = "test" err = m.VerifyAndAdjust() c.Assert(terror.ErrConfigLoaderCfgConflict.Equal(err), IsTrue) - m.RemoveDuplicateCfg() + m.Loader = nil m.Syncer = &SyncerConfig{} m.SyncerConfigName = "test" err = m.VerifyAndAdjust() c.Assert(terror.ErrConfigSyncerCfgConflict.Equal(err), IsTrue) - m.RemoveDuplicateCfg() + m.SyncerConfigName = "" c.Assert(m.VerifyAndAdjust(), IsNil) diff --git a/dm/ctl/ctl.go b/dm/ctl/ctl.go index 6752fe2fd4..4ca3827393 100644 --- a/dm/ctl/ctl.go +++ b/dm/ctl/ctl.go @@ -72,7 +72,7 @@ func NewRootCmd() *cobra.Command { master.NewOperateLeaderCmd(), master.NewListMemberCmd(), master.NewOperateSchemaCmd(), - master.NewGetTaskCfgCmd(), + master.NewGetCfgCmd(), master.NewHandleErrorCmd(), ) return cmd diff --git a/dm/ctl/master/get_task_config.go b/dm/ctl/master/get_config.go similarity index 59% rename from dm/ctl/master/get_task_config.go rename to dm/ctl/master/get_config.go index a9bd856f3c..c351962395 100644 --- a/dm/ctl/master/get_task_config.go +++ b/dm/ctl/master/get_config.go @@ -26,26 +26,50 @@ import ( "github.com/pingcap/dm/dm/pb" ) -// NewGetTaskCfgCmd creates a getTaskCfg command -func NewGetTaskCfgCmd() *cobra.Command { +// NewGetCfgCmd creates a getCfg command +func NewGetCfgCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "get-task-config [--file filename]", - Short: "Gets the task configuration.", - RunE: getTaskCfgFunc, + Use: "get-config [--file filename]", + Short: "Gets the configuration.", + RunE: getCfgFunc, } cmd.Flags().StringP("file", "f", "", "write config to file") return cmd } -// getTaskCfgFunc does get task's config -func getTaskCfgFunc(cmd *cobra.Command, _ []string) (err error) { - if len(cmd.Flags().Args()) != 1 { +func convertCfgType(t string) pb.CfgType { + switch t { + case "task": + return pb.CfgType_TaskType + case "master": + return pb.CfgType_MasterType + case "worker": + return pb.CfgType_WorkerType + case "source": + return pb.CfgType_SourceType + default: + return pb.CfgType_InvalidType + } +} + +// getCfgFunc gets config +func getCfgFunc(cmd *cobra.Command, _ []string) (err error) { + if len(cmd.Flags().Args()) != 2 { cmd.SetOut(os.Stdout) common.PrintCmdUsage(cmd) err = errors.New("please check output to see error") return } - taskName := common.GetTaskNameFromArgOrFile(cmd.Flags().Arg(0)) + + cfgType := cmd.Flags().Arg(0) + tp := convertCfgType(cfgType) + if tp == pb.CfgType_InvalidType { + common.PrintLines("invalid config type '%s'", cfgType) + err = errors.New("please check output to see error") + return + } + + cfgName := cmd.Flags().Arg(1) filename, err := cmd.Flags().GetString("file") if err != nil { common.PrintLines("can not get filename") @@ -56,11 +80,12 @@ func getTaskCfgFunc(cmd *cobra.Command, _ []string) (err error) { ctx, cancel := context.WithTimeout(context.Background(), common.GlobalConfig().RPCTimeout) defer cancel() - resp, err := cli.GetTaskCfg(ctx, &pb.GetTaskCfgRequest{ - Name: taskName, + resp, err := cli.GetCfg(ctx, &pb.GetCfgRequest{ + Type: tp, + Name: cfgName, }) if err != nil { - common.PrintLines("can not get config of task %s", taskName) + common.PrintLines("can not get %s config of %s", cfgType, cfgName) return } diff --git a/dm/master/bootstrap.go b/dm/master/bootstrap.go index 0a17d7527d..5b5d32186a 100644 --- a/dm/master/bootstrap.go +++ b/dm/master/bootstrap.go @@ -19,7 +19,6 @@ import ( "io/ioutil" "os" "path/filepath" - "sort" "strings" "sync" "time" @@ -346,14 +345,12 @@ func (s *Server) createSubtaskV1Import(tctx *tcontext.Context, var err error outerLoop: for taskName, taskCfgs := range cfgs { - cfgLists := make([]*config.SubTaskConfig, 0, len(taskCfgs)) for sourceID, cfg := range taskCfgs { var cfg2 *config.SubTaskConfig cfg2, err = cfg.DecryptPassword() if err != nil { break outerLoop } - cfgLists = append(cfgLists, cfg2) stage := stages[taskName][sourceID] switch stage { case pb.Stage_Running, pb.Stage_Paused: @@ -378,15 +375,6 @@ outerLoop: } } } - sort.Slice(cfgLists, func(i, j int) bool { - return cfgLists[i].SourceID < cfgLists[j].SourceID - }) - var mergedCfg config.TaskConfig - mergedCfg.FromSubTaskConfigs(cfgLists...) - err2 := s.scheduler.AddTaskCfg(mergedCfg) - if err2 != nil { - tctx.Logger.Error("fail to add task config into the cluster") // only log it - } } return err } diff --git a/dm/master/config.go b/dm/master/config.go index 81fa86269b..27ce41bfde 100644 --- a/dm/master/config.go +++ b/dm/master/config.go @@ -14,6 +14,7 @@ package master import ( + "bytes" "encoding/base64" "encoding/json" "flag" @@ -55,9 +56,8 @@ var ( // NewConfig creates a config for dm-master func NewConfig() *Config { cfg := &Config{} - cfg.Debug = false - cfg.FlagSet = flag.NewFlagSet("dm-master", flag.ContinueOnError) - fs := cfg.FlagSet + cfg.flagSet = flag.NewFlagSet("dm-master", flag.ContinueOnError) + fs := cfg.flagSet fs.BoolVar(&cfg.printVersion, "V", false, "prints version and exit") fs.BoolVar(&cfg.printSampleConfig, "print-sample-config", false, "print sample config file of dm-worker") @@ -88,7 +88,7 @@ func NewConfig() *Config { // Config is the configuration for dm-master type Config struct { - *flag.FlagSet `json:"-"` + flagSet *flag.FlagSet LogLevel string `toml:"log-level" json:"log-level"` LogFile string `toml:"log-file" json:"log-file"` @@ -96,14 +96,14 @@ type Config struct { LogRotate string `toml:"log-rotate" json:"log-rotate"` RPCTimeoutStr string `toml:"rpc-timeout" json:"rpc-timeout"` - RPCTimeout time.Duration `json:"-"` + RPCTimeout time.Duration `toml:"-" json:"-"` RPCRateLimit float64 `toml:"rpc-rate-limit" json:"rpc-rate-limit"` RPCRateBurst int `toml:"rpc-rate-burst" json:"rpc-rate-burst"` MasterAddr string `toml:"master-addr" json:"master-addr"` AdvertiseAddr string `toml:"advertise-addr" json:"advertise-addr"` - ConfigFile string `json:"config-file"` + ConfigFile string `toml:"config-file" json:"config-file"` // etcd relative config items // NOTE: we use `MasterAddr` to generate `ClientUrls` and `AdvertiseClientUrls` @@ -114,8 +114,7 @@ type Config struct { AdvertisePeerUrls string `toml:"advertise-peer-urls" json:"advertise-peer-urls"` InitialCluster string `toml:"initial-cluster" json:"initial-cluster"` InitialClusterState string `toml:"initial-cluster-state" json:"initial-cluster-state"` - Join string `toml:"join" json:"join"` // cluster's client address (endpoints), not peer address - Debug bool `toml:"debug" json:"debug"` // only use for test + Join string `toml:"join" json:"join"` // cluster's client address (endpoints), not peer address // directory path used to store source config files when upgrading from v1.0.x. // if this path set, DM-master leader will try to upgrade from v1.0.x to the current version. @@ -137,10 +136,22 @@ func (c *Config) String() string { return string(cfg) } +// Toml returns TOML format representation of config +func (c *Config) Toml() (string, error) { + var b bytes.Buffer + + err := toml.NewEncoder(&b).Encode(c) + if err != nil { + log.L().Error("fail to marshal config to toml", log.ShortError(err)) + } + + return b.String(), nil +} + // Parse parses flag definitions from the argument list. func (c *Config) Parse(arguments []string) error { // Parse first to get config file. - err := c.FlagSet.Parse(arguments) + err := c.flagSet.Parse(arguments) if err != nil { return terror.ErrMasterConfigParseFlagSet.Delegate(err) } @@ -173,13 +184,13 @@ func (c *Config) Parse(arguments []string) error { } // Parse again to replace with command line options. - err = c.FlagSet.Parse(arguments) + err = c.flagSet.Parse(arguments) if err != nil { return terror.ErrMasterConfigParseFlagSet.Delegate(err) } - if len(c.FlagSet.Args()) != 0 { - return terror.ErrMasterConfigInvalidFlag.Generate(c.FlagSet.Arg(0)) + if len(c.flagSet.Args()) != 0 { + return terror.ErrMasterConfigInvalidFlag.Generate(c.flagSet.Arg(0)) } return c.adjust() diff --git a/dm/master/scheduler/scheduler.go b/dm/master/scheduler/scheduler.go index 84f6adddfa..445fc250f3 100644 --- a/dm/master/scheduler/scheduler.go +++ b/dm/master/scheduler/scheduler.go @@ -76,14 +76,6 @@ type Scheduler struct { // - remove source by user request (calling `RemoveSourceCfg`). sourceCfgs map[string]config.SourceConfig - // all task configs string, task name -> task config string. - // add: - // - add/start task by user request (calling `StartTask`). - // - recover from etcd (calling `recoverTaskCfgs`). - // delete: - // - remove/stop task by user request (calling `StopTask`). - taskCfgs map[string]string - // all subtask configs, task name -> source ID -> subtask config. // add: // - add/start subtask by user request (calling `AddSubTasks`). @@ -147,7 +139,6 @@ func NewScheduler(pLogger *log.Logger, securityCfg config.Security) *Scheduler { return &Scheduler{ logger: pLogger.WithFields(zap.String("component", "scheduler")), sourceCfgs: make(map[string]config.SourceConfig), - taskCfgs: make(map[string]string), subTaskCfgs: make(map[string]map[string]config.SubTaskConfig), workers: make(map[string]*Worker), bounds: make(map[string]*Worker), @@ -178,10 +169,6 @@ func (s *Scheduler) Start(pCtx context.Context, etcdCli *clientv3.Client) error if err != nil { return err } - err = s.recoverTaskCfgs(etcdCli) - if err != nil { - return err - } err = s.recoverSubTasks(etcdCli) if err != nil { return err @@ -336,126 +323,6 @@ func (s *Scheduler) RemoveSourceCfg(source string) error { return nil } -// GetTaskCfg gets config of task -func (s *Scheduler) GetTaskCfg(task string) string { - s.mu.RLock() - defer s.mu.RUnlock() - cfg, ok := s.taskCfgs[task] - if !ok { - return "" - } - return cfg -} - -// AddTaskCfg adds the config of task -func (s *Scheduler) AddTaskCfg(cfg config.TaskConfig) error { - s.mu.Lock() - defer s.mu.Unlock() - - if !s.started { - return terror.ErrSchedulerNotStarted.Generate() - } - - if len(cfg.Name) == 0 { - return nil - } - - // 1. check whether exists. - // return nil because we may use `start-task -s source` for subtask - if _, ok := s.taskCfgs[cfg.Name]; ok { - return nil - } - - // 2. put the config into etcd. - clone := cfg - for _, mysqlInstance := range clone.MySQLInstances { - mysqlInstance.RemoveDuplicateCfg() - } - - taskCfg := clone.String() - _, err := ha.PutTaskCfg(s.etcdCli, clone.Name, taskCfg) - if err != nil { - return err - } - - // 3. record the config - s.taskCfgs[clone.Name] = taskCfg - - return nil -} - -// UpdateTaskCfg update the config of task -func (s *Scheduler) UpdateTaskCfg(cfg config.TaskConfig) error { - s.mu.Lock() - defer s.mu.Unlock() - - if !s.started { - return terror.ErrSchedulerNotStarted.Generate() - } - - if len(cfg.Name) == 0 { - return nil - } - - // 1. check whether exists. - if _, ok := s.taskCfgs[cfg.Name]; !ok { - return terror.ErrSchedulerTaskNotExist.Generate(cfg.Name) - } - - // 2. put the config into etcd. - clone := cfg - for _, mysqlInstance := range clone.MySQLInstances { - mysqlInstance.RemoveDuplicateCfg() - } - - taskCfg := clone.String() - _, err := ha.PutTaskCfg(s.etcdCli, clone.Name, taskCfg) - if err != nil { - return err - } - - // 3. record the config - s.taskCfgs[clone.Name] = taskCfg - - return nil -} - -// RemoveTaskCfg removes the config of task -func (s *Scheduler) RemoveTaskCfg(task string) error { - s.mu.Lock() - defer s.mu.Unlock() - - if !s.started { - return terror.ErrSchedulerNotStarted.Generate() - } - - // do not remove task if has subtask - // return nil because we may use `stop-task -s source` for subtask - if _, ok := s.subTaskCfgs[task]; ok { - return nil - } - - if task == "" { - return nil - } - - // 1. check the task exists. - if _, ok := s.taskCfgs[task]; !ok { - return terror.ErrSchedulerTaskNotExist.Generate(task) - } - - // 2. delete the config in etcd - _, err := ha.DeleteTaskCfg(s.etcdCli, task) - if err != nil { - return err - } - - // 3. clear the config - delete(s.taskCfgs, task) - - return nil -} - // GetSourceCfgIDs gets all added source ID func (s *Scheduler) GetSourceCfgIDs() []string { s.mu.RLock() @@ -987,22 +854,6 @@ func (s *Scheduler) recoverSources(cli *clientv3.Client) error { return nil } -// recoverTaskCfgs recovers history task config string from etcd. -func (s *Scheduler) recoverTaskCfgs(cli *clientv3.Client) error { - // get all task configs. - cfgM, _, err := ha.GetTaskCfg(cli, "") - if err != nil { - return err - } - - // recover in-memory data. - for task, cfg := range cfgM { - s.taskCfgs[task] = cfg - } - - return nil -} - // recoverSubTasks recovers history subtask configs and expectant subtask stages from etcd. func (s *Scheduler) recoverSubTasks(cli *clientv3.Client) error { // get all subtask configs. diff --git a/dm/master/server.go b/dm/master/server.go index 08651a8856..460bee1f45 100644 --- a/dm/master/server.go +++ b/dm/master/server.go @@ -461,12 +461,6 @@ func (s *Server) StartTask(ctx context.Context, req *pb.StartTaskRequest) (*pb.S return resp, nil } - err = s.scheduler.AddTaskCfg(*cfg) - if err != nil { - resp.Msg = err.Error() - return resp, nil - } - resp.Result = true if cfg.RemoveMeta { resp.Msg = "`remove-meta` in task config is deprecated, please use `start-task ... --remove-meta` instead" @@ -517,11 +511,6 @@ func (s *Server) OperateTask(ctx context.Context, req *pb.OperateTaskRequest) (* var err error if expect == pb.Stage_Stopped { err = s.scheduler.RemoveSubTasks(req.Name, sources...) - if err != nil { - resp.Msg = err.Error() - return resp, nil - } - err = s.scheduler.RemoveTaskCfg(req.Name) } else { err = s.scheduler.UpdateExpectSubTaskStage(expect, req.Name, sources...) } @@ -754,20 +743,18 @@ func (s *Server) UnlockDDLLock(ctx context.Context, req *pb.UnlockDDLLockRequest resp.Msg = "can't find task name from lock-ID" return resp, nil } - cfgStr := s.scheduler.GetTaskCfg(task) - if cfgStr == "" { + subtasks := s.scheduler.GetSubTaskCfgsByTask(task) + if len(subtasks) == 0 { resp.Msg = "task (" + task + ") which extracted from lock-ID is not found in DM" return resp, nil } - cfg := config.NewTaskConfig() - if err := cfg.Decode(cfgStr); err != nil { - resp.Msg = err.Error() - return resp, nil - } - if cfg.ShardMode != config.ShardPessimistic { - resp.Msg = "`unlock-ddl-lock` is only supported in pessimistic shard mode currently" - return resp, nil + for _, subtask := range subtasks { + if subtask.ShardMode != config.ShardPessimistic { + resp.Msg = "`unlock-ddl-lock` is only supported in pessimistic shard mode currently" + return resp, nil + } + break } // TODO: add `unlock-ddl-lock` support for Optimist later. @@ -1781,27 +1768,139 @@ func (s *Server) OperateSchema(ctx context.Context, req *pb.OperateSchemaRequest }, nil } -// GetTaskCfg implements MasterServer.GetSubTaskCfg -func (s *Server) GetTaskCfg(ctx context.Context, req *pb.GetTaskCfgRequest) (*pb.GetTaskCfgResponse, error) { +func (s *Server) createMasterClientByName(ctx context.Context, name string) (pb.MasterClient, error) { + listResp, err := s.etcdClient.MemberList(ctx) + if err != nil { + return nil, err + } + clientURLs := []string{} + for _, m := range listResp.Members { + if name == m.Name { + for _, url := range m.GetClientURLs() { + clientURLs = append(clientURLs, utils.UnwrapScheme(url)) + } + break + } + } + if len(clientURLs) == 0 { + return nil, errors.New("master not found") + } + tls, err := toolutils.NewTLS(s.cfg.SSLCA, s.cfg.SSLCert, s.cfg.SSLKey, s.cfg.AdvertiseAddr, s.cfg.CertAllowedCN) + if err != nil { + return nil, err + } + + var conn *grpc.ClientConn + for _, clientURL := range clientURLs { + //nolint:staticcheck + conn, err = grpc.Dial(clientURL, tls.ToGRPCDialOption(), grpc.WithBackoffMaxDelay(3*time.Second)) + if err == nil { + masterClient := pb.NewMasterClient(conn) + return masterClient, nil + } + log.L().Error("can not dial to master", zap.String("name", name), zap.String("client url", clientURL), log.ShortError(err)) + } + // return last err + return nil, err +} + +// GetMasterCfg implements MasterServer.GetMasterCfg +func (s *Server) GetMasterCfg(ctx context.Context, req *pb.GetMasterCfgRequest) (*pb.GetMasterCfgResponse, error) { + log.L().Info("", zap.Any("payload", req), zap.String("request", "GetMasterCfg")) + + var err error + resp := &pb.GetMasterCfgResponse{} + resp.Cfg, err = s.cfg.Toml() + return resp, err +} + +// GetCfg implements MasterServer.GetCfg +func (s *Server) GetCfg(ctx context.Context, req *pb.GetCfgRequest) (*pb.GetCfgResponse, error) { var ( - resp2 *pb.GetTaskCfgResponse + resp2 = &pb.GetCfgResponse{} err2 error + cfg string ) shouldRet := s.sharedLogic(ctx, req, &resp2, &err2) if shouldRet { return resp2, err2 } - cfg := s.scheduler.GetTaskCfg(req.Name) + switch req.Type { + case pb.CfgType_TaskType: + subCfgMap := s.scheduler.GetSubTaskCfgsByTask(req.Name) + if len(subCfgMap) == 0 { + resp2.Msg = "task not found" + return resp2, nil + } + subCfgList := make([]*config.SubTaskConfig, 0, len(subCfgMap)) + for _, subCfg := range subCfgMap { + subCfgList = append(subCfgList, subCfg) + } + sort.Slice(subCfgList, func(i, j int) bool { + return subCfgList[i].SourceID < subCfgList[j].SourceID + }) - if len(cfg) == 0 { - return &pb.GetTaskCfgResponse{ - Result: false, - Msg: "task not found", - }, nil + taskCfg := config.FromSubTaskConfigs(subCfgList...) + taskCfg.TargetDB.Password = "******" + cfg = taskCfg.String() + case pb.CfgType_MasterType: + if req.Name == s.cfg.Name { + cfg, err2 = s.cfg.Toml() + if err2 != nil { + resp2.Msg = err2.Error() + } else { + resp2.Result = true + resp2.Cfg = cfg + } + return resp2, nil + } + + masterClient, err := s.createMasterClientByName(ctx, req.Name) + if err != nil { + resp2.Msg = err.Error() + return resp2, nil + } + masterResp, err := masterClient.GetMasterCfg(ctx, &pb.GetMasterCfgRequest{}) + if err != nil { + resp2.Msg = err.Error() + return resp2, nil + } + cfg = masterResp.Cfg + case pb.CfgType_WorkerType: + worker := s.scheduler.GetWorkerByName(req.Name) + if worker == nil { + resp2.Msg = "worker not found" + return resp2, nil + } + workerReq := workerrpc.Request{ + Type: workerrpc.CmdGetWorkerCfg, + GetWorkerCfg: &pb.GetWorkerCfgRequest{}, + } + workerResp, err := worker.SendRequest(ctx, &workerReq, s.cfg.RPCTimeout) + if err != nil { + resp2.Msg = err.Error() + return resp2, nil + } + cfg = workerResp.GetWorkerCfg.Cfg + case pb.CfgType_SourceType: + sourceCfg := s.scheduler.GetSourceCfgByID(req.Name) + if sourceCfg == nil { + resp2.Msg = "source not found" + return resp2, nil + } + sourceCfg.From.Password = "******" + cfg, err2 = sourceCfg.Yaml() + if err2 != nil { + resp2.Msg = err2.Error() + return resp2, nil + } + default: + resp2.Msg = fmt.Sprintf("invalid config op '%s'", req.Type) + return resp2, nil } - return &pb.GetTaskCfgResponse{ + return &pb.GetCfgResponse{ Result: true, Cfg: cfg, }, nil diff --git a/dm/master/server_test.go b/dm/master/server_test.go index 213d75e1a9..dbbf285697 100644 --- a/dm/master/server_test.go +++ b/dm/master/server_test.go @@ -1551,7 +1551,7 @@ func (t *testMaster) TestOfflineMember(c *check.C) { clearSchedulerEnv(c, cancel, &wg) } -func (t *testMaster) TestGetTaskCfg(c *check.C) { +func (t *testMaster) TestGetCfg(c *check.C) { ctrl := gomock.NewController(c) defer ctrl.Finish() @@ -1567,6 +1567,7 @@ func (t *testMaster) TestGetTaskCfg(c *check.C) { } server.scheduler, _ = testMockScheduler(ctx, &wg, c, sources, workers, "", makeWorkerClientsForHandle(ctrl, taskName, sources, workers, req)) + server.etcdClient = etcdTestCli // start task mock := t.initVersionDB(c) @@ -1580,31 +1581,79 @@ func (t *testMaster) TestGetTaskCfg(c *check.C) { c.Assert(resp.Result, check.IsTrue) // get task config - req1 := &pb.GetTaskCfgRequest{ + req1 := &pb.GetCfgRequest{ Name: taskName, + Type: pb.CfgType_TaskType, } - resp1, err := server.GetTaskCfg(context.Background(), req1) + resp1, err := server.GetCfg(context.Background(), req1) c.Assert(err, check.IsNil) c.Assert(resp1.Result, check.IsTrue) c.Assert(strings.Contains(resp1.Cfg, "name: test"), check.IsTrue) // wrong task name - req2 := &pb.GetTaskCfgRequest{ + req2 := &pb.GetCfgRequest{ Name: "haha", + Type: pb.CfgType_TaskType, } - resp2, err := server.GetTaskCfg(context.Background(), req2) + resp2, err := server.GetCfg(context.Background(), req2) c.Assert(err, check.IsNil) c.Assert(resp2.Result, check.IsFalse) + c.Assert(resp2.Msg, check.Equals, "task not found") - // test recover from etcd + // test restart master server.scheduler.Close() c.Assert(server.scheduler.Start(ctx, etcdTestCli), check.IsNil) - resp3, err := server.GetTaskCfg(context.Background(), req1) + resp3, err := server.GetCfg(context.Background(), req1) c.Assert(err, check.IsNil) c.Assert(resp3.Result, check.IsTrue) c.Assert(resp3.Cfg, check.Equals, resp1.Cfg) + req3 := &pb.GetCfgRequest{ + Name: "dm-master", + Type: pb.CfgType_MasterType, + } + resp4, err := server.GetCfg(context.Background(), req3) + c.Assert(err, check.IsNil) + c.Assert(resp4.Result, check.IsTrue) + c.Assert(strings.Contains(resp4.Cfg, "name = \"dm-master\""), check.IsTrue) + + req4 := &pb.GetCfgRequest{ + Name: "haha", + Type: pb.CfgType_MasterType, + } + resp5, err := server.GetCfg(context.Background(), req4) + c.Assert(err, check.IsNil) + c.Assert(resp5.Result, check.IsFalse) + c.Assert(resp5.Msg, check.Equals, "master not found") + + req5 := &pb.GetCfgRequest{ + Name: "haha", + Type: pb.CfgType_WorkerType, + } + resp6, err := server.GetCfg(context.Background(), req5) + c.Assert(err, check.IsNil) + c.Assert(resp6.Result, check.IsFalse) + c.Assert(resp6.Msg, check.Equals, "worker not found") + + req6 := &pb.GetCfgRequest{ + Name: "mysql-replica-01", + Type: pb.CfgType_SourceType, + } + resp7, err := server.GetCfg(context.Background(), req6) + c.Assert(err, check.IsNil) + c.Assert(resp7.Result, check.IsTrue) + c.Assert(strings.Contains(resp7.Cfg, "source-id: mysql-replica-01"), check.IsTrue, check.Commentf(resp7.Cfg)) + + req7 := &pb.GetCfgRequest{ + Name: "haha", + Type: pb.CfgType_SourceType, + } + resp8, err := server.GetCfg(context.Background(), req7) + c.Assert(err, check.IsNil) + c.Assert(resp8.Result, check.IsFalse) + c.Assert(resp8.Msg, check.Equals, "source not found") + clearSchedulerEnv(c, cancel, &wg) } diff --git a/dm/master/workerrpc/interface.go b/dm/master/workerrpc/interface.go index 73d2c614ec..cbda750e2f 100644 --- a/dm/master/workerrpc/interface.go +++ b/dm/master/workerrpc/interface.go @@ -46,6 +46,7 @@ const ( CmdOperateV1Meta CmdHandleError + CmdGetWorkerCfg ) // Request wraps all dm-worker rpc requests. @@ -60,6 +61,7 @@ type Request struct { OperateV1Meta *pb.OperateV1MetaRequest HandleError *pb.HandleWorkerErrorRequest + GetWorkerCfg *pb.GetWorkerCfgRequest } // Response wraps all dm-worker rpc responses. @@ -74,6 +76,7 @@ type Response struct { OperateV1Meta *pb.OperateV1MetaResponse HandleError *pb.CommonWorkerResponse + GetWorkerCfg *pb.GetWorkerCfgResponse } // Client is a client that sends RPC. diff --git a/dm/master/workerrpc/rawgrpc.go b/dm/master/workerrpc/rawgrpc.go index 0b3cf814ef..4b90dcced5 100644 --- a/dm/master/workerrpc/rawgrpc.go +++ b/dm/master/workerrpc/rawgrpc.go @@ -113,6 +113,8 @@ func callRPC(ctx context.Context, client pb.WorkerClient, req *Request) (*Respon resp.OperateV1Meta, err = client.OperateV1Meta(ctx, req.OperateV1Meta) case CmdHandleError: resp.HandleError, err = client.HandleError(ctx, req.HandleError) + case CmdGetWorkerCfg: + resp.GetWorkerCfg, err = client.GetWorkerCfg(ctx, req.GetWorkerCfg) default: return nil, terror.ErrMasterGRPCInvalidReqType.Generate(req.Type) } diff --git a/dm/pb/dmmaster.pb.go b/dm/pb/dmmaster.pb.go index 65f3e859bd..91233745d7 100644 --- a/dm/pb/dmmaster.pb.go +++ b/dm/pb/dmmaster.pb.go @@ -90,6 +90,40 @@ func (LeaderOp) EnumDescriptor() ([]byte, []int) { return fileDescriptor_f9bef11f2a341f03, []int{1} } +type CfgType int32 + +const ( + CfgType_InvalidType CfgType = 0 + CfgType_TaskType CfgType = 1 + CfgType_MasterType CfgType = 2 + CfgType_WorkerType CfgType = 3 + CfgType_SourceType CfgType = 4 +) + +var CfgType_name = map[int32]string{ + 0: "InvalidType", + 1: "TaskType", + 2: "MasterType", + 3: "WorkerType", + 4: "SourceType", +} + +var CfgType_value = map[string]int32{ + "InvalidType": 0, + "TaskType": 1, + "MasterType": 2, + "WorkerType": 3, + "SourceType": 4, +} + +func (x CfgType) String() string { + return proto.EnumName(CfgType_name, int32(x)) +} + +func (CfgType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_f9bef11f2a341f03, []int{2} +} + type StartTaskRequest struct { Task string `protobuf:"bytes,1,opt,name=task,proto3" json:"task,omitempty"` Sources []string `protobuf:"bytes,2,rep,name=sources,proto3" json:"sources,omitempty"` @@ -2467,23 +2501,23 @@ func (m *GetSubTaskCfgResponse) GetCfgs() []string { return nil } -type GetTaskCfgRequest struct { - // the task name - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +type GetCfgRequest struct { + Type CfgType `protobuf:"varint,1,opt,name=type,proto3,enum=pb.CfgType" json:"type,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` } -func (m *GetTaskCfgRequest) Reset() { *m = GetTaskCfgRequest{} } -func (m *GetTaskCfgRequest) String() string { return proto.CompactTextString(m) } -func (*GetTaskCfgRequest) ProtoMessage() {} -func (*GetTaskCfgRequest) Descriptor() ([]byte, []int) { +func (m *GetCfgRequest) Reset() { *m = GetCfgRequest{} } +func (m *GetCfgRequest) String() string { return proto.CompactTextString(m) } +func (*GetCfgRequest) ProtoMessage() {} +func (*GetCfgRequest) Descriptor() ([]byte, []int) { return fileDescriptor_f9bef11f2a341f03, []int{39} } -func (m *GetTaskCfgRequest) XXX_Unmarshal(b []byte) error { +func (m *GetCfgRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetTaskCfgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetCfgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetTaskCfgRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_GetCfgRequest.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2493,43 +2527,50 @@ func (m *GetTaskCfgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, e return b[:n], nil } } -func (m *GetTaskCfgRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTaskCfgRequest.Merge(m, src) +func (m *GetCfgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCfgRequest.Merge(m, src) } -func (m *GetTaskCfgRequest) XXX_Size() int { +func (m *GetCfgRequest) XXX_Size() int { return m.Size() } -func (m *GetTaskCfgRequest) XXX_DiscardUnknown() { - xxx_messageInfo_GetTaskCfgRequest.DiscardUnknown(m) +func (m *GetCfgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetCfgRequest.DiscardUnknown(m) } -var xxx_messageInfo_GetTaskCfgRequest proto.InternalMessageInfo +var xxx_messageInfo_GetCfgRequest proto.InternalMessageInfo + +func (m *GetCfgRequest) GetType() CfgType { + if m != nil { + return m.Type + } + return CfgType_InvalidType +} -func (m *GetTaskCfgRequest) GetName() string { +func (m *GetCfgRequest) GetName() string { if m != nil { return m.Name } return "" } -type GetTaskCfgResponse struct { +type GetCfgResponse 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"` Cfg string `protobuf:"bytes,3,opt,name=cfg,proto3" json:"cfg,omitempty"` } -func (m *GetTaskCfgResponse) Reset() { *m = GetTaskCfgResponse{} } -func (m *GetTaskCfgResponse) String() string { return proto.CompactTextString(m) } -func (*GetTaskCfgResponse) ProtoMessage() {} -func (*GetTaskCfgResponse) Descriptor() ([]byte, []int) { +func (m *GetCfgResponse) Reset() { *m = GetCfgResponse{} } +func (m *GetCfgResponse) String() string { return proto.CompactTextString(m) } +func (*GetCfgResponse) ProtoMessage() {} +func (*GetCfgResponse) Descriptor() ([]byte, []int) { return fileDescriptor_f9bef11f2a341f03, []int{40} } -func (m *GetTaskCfgResponse) XXX_Unmarshal(b []byte) error { +func (m *GetCfgResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GetTaskCfgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *GetCfgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GetTaskCfgResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_GetCfgResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -2539,33 +2580,113 @@ func (m *GetTaskCfgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *GetTaskCfgResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_GetTaskCfgResponse.Merge(m, src) +func (m *GetCfgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetCfgResponse.Merge(m, src) } -func (m *GetTaskCfgResponse) XXX_Size() int { +func (m *GetCfgResponse) XXX_Size() int { return m.Size() } -func (m *GetTaskCfgResponse) XXX_DiscardUnknown() { - xxx_messageInfo_GetTaskCfgResponse.DiscardUnknown(m) +func (m *GetCfgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetCfgResponse.DiscardUnknown(m) } -var xxx_messageInfo_GetTaskCfgResponse proto.InternalMessageInfo +var xxx_messageInfo_GetCfgResponse proto.InternalMessageInfo -func (m *GetTaskCfgResponse) GetResult() bool { +func (m *GetCfgResponse) GetResult() bool { if m != nil { return m.Result } return false } -func (m *GetTaskCfgResponse) GetMsg() string { +func (m *GetCfgResponse) GetMsg() string { if m != nil { return m.Msg } return "" } -func (m *GetTaskCfgResponse) GetCfg() string { +func (m *GetCfgResponse) GetCfg() string { + if m != nil { + return m.Cfg + } + return "" +} + +type GetMasterCfgRequest struct { +} + +func (m *GetMasterCfgRequest) Reset() { *m = GetMasterCfgRequest{} } +func (m *GetMasterCfgRequest) String() string { return proto.CompactTextString(m) } +func (*GetMasterCfgRequest) ProtoMessage() {} +func (*GetMasterCfgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f9bef11f2a341f03, []int{41} +} +func (m *GetMasterCfgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetMasterCfgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetMasterCfgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetMasterCfgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMasterCfgRequest.Merge(m, src) +} +func (m *GetMasterCfgRequest) XXX_Size() int { + return m.Size() +} +func (m *GetMasterCfgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetMasterCfgRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMasterCfgRequest proto.InternalMessageInfo + +type GetMasterCfgResponse struct { + Cfg string `protobuf:"bytes,1,opt,name=cfg,proto3" json:"cfg,omitempty"` +} + +func (m *GetMasterCfgResponse) Reset() { *m = GetMasterCfgResponse{} } +func (m *GetMasterCfgResponse) String() string { return proto.CompactTextString(m) } +func (*GetMasterCfgResponse) ProtoMessage() {} +func (*GetMasterCfgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f9bef11f2a341f03, []int{42} +} +func (m *GetMasterCfgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetMasterCfgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetMasterCfgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetMasterCfgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetMasterCfgResponse.Merge(m, src) +} +func (m *GetMasterCfgResponse) XXX_Size() int { + return m.Size() +} +func (m *GetMasterCfgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetMasterCfgResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetMasterCfgResponse proto.InternalMessageInfo + +func (m *GetMasterCfgResponse) GetCfg() string { if m != nil { return m.Cfg } @@ -2584,7 +2705,7 @@ func (m *HandleErrorRequest) Reset() { *m = HandleErrorRequest{} } func (m *HandleErrorRequest) String() string { return proto.CompactTextString(m) } func (*HandleErrorRequest) ProtoMessage() {} func (*HandleErrorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_f9bef11f2a341f03, []int{41} + return fileDescriptor_f9bef11f2a341f03, []int{43} } func (m *HandleErrorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2658,7 +2779,7 @@ func (m *HandleErrorResponse) Reset() { *m = HandleErrorResponse{} } func (m *HandleErrorResponse) String() string { return proto.CompactTextString(m) } func (*HandleErrorResponse) ProtoMessage() {} func (*HandleErrorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_f9bef11f2a341f03, []int{42} + return fileDescriptor_f9bef11f2a341f03, []int{44} } func (m *HandleErrorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -2711,6 +2832,7 @@ func (m *HandleErrorResponse) GetSources() []*CommonWorkerResponse { func init() { proto.RegisterEnum("pb.SourceOp", SourceOp_name, SourceOp_value) proto.RegisterEnum("pb.LeaderOp", LeaderOp_name, LeaderOp_value) + proto.RegisterEnum("pb.CfgType", CfgType_name, CfgType_value) proto.RegisterType((*StartTaskRequest)(nil), "pb.StartTaskRequest") proto.RegisterType((*StartTaskResponse)(nil), "pb.StartTaskResponse") proto.RegisterType((*OperateTaskRequest)(nil), "pb.OperateTaskRequest") @@ -2750,8 +2872,10 @@ func init() { proto.RegisterType((*OperateSchemaResponse)(nil), "pb.OperateSchemaResponse") proto.RegisterType((*GetSubTaskCfgRequest)(nil), "pb.GetSubTaskCfgRequest") proto.RegisterType((*GetSubTaskCfgResponse)(nil), "pb.GetSubTaskCfgResponse") - proto.RegisterType((*GetTaskCfgRequest)(nil), "pb.GetTaskCfgRequest") - proto.RegisterType((*GetTaskCfgResponse)(nil), "pb.GetTaskCfgResponse") + proto.RegisterType((*GetCfgRequest)(nil), "pb.GetCfgRequest") + proto.RegisterType((*GetCfgResponse)(nil), "pb.GetCfgResponse") + proto.RegisterType((*GetMasterCfgRequest)(nil), "pb.GetMasterCfgRequest") + proto.RegisterType((*GetMasterCfgResponse)(nil), "pb.GetMasterCfgResponse") proto.RegisterType((*HandleErrorRequest)(nil), "pb.HandleErrorRequest") proto.RegisterType((*HandleErrorResponse)(nil), "pb.HandleErrorResponse") } @@ -2759,119 +2883,125 @@ func init() { func init() { proto.RegisterFile("dmmaster.proto", fileDescriptor_f9bef11f2a341f03) } var fileDescriptor_f9bef11f2a341f03 = []byte{ - // 1781 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x58, 0x4b, 0x6f, 0xdb, 0xd8, - 0x15, 0x16, 0x25, 0xd9, 0x96, 0x8f, 0x6c, 0x47, 0xbe, 0x96, 0x65, 0x99, 0x76, 0x14, 0xe7, 0x36, - 0x49, 0x0d, 0xa3, 0xb0, 0x10, 0xb7, 0xab, 0x00, 0x29, 0x90, 0x58, 0x79, 0x18, 0x75, 0xea, 0x94, - 0xae, 0x51, 0x04, 0x05, 0x8a, 0x50, 0xd4, 0x95, 0x4c, 0x98, 0x22, 0x19, 0x92, 0xb2, 0x6b, 0x04, - 0xd9, 0xf4, 0x07, 0xf4, 0x81, 0x2e, 0xb2, 0x9c, 0xc5, 0x6c, 0xe7, 0x87, 0xcc, 0x32, 0xc0, 0x6c, - 0x66, 0x39, 0x48, 0xe6, 0x4f, 0xcc, 0x6e, 0x70, 0xcf, 0xbd, 0xa4, 0xf8, 0x92, 0x27, 0x0a, 0x30, - 0xde, 0xf1, 0xdc, 0x73, 0x79, 0xbe, 0xf3, 0xe2, 0x79, 0x10, 0x96, 0x7a, 0xc3, 0xa1, 0xee, 0x07, - 0xcc, 0xdb, 0x75, 0x3d, 0x27, 0x70, 0x48, 0xd1, 0xed, 0xaa, 0x4b, 0xbd, 0xe1, 0x85, 0xe3, 0x9d, - 0x85, 0x67, 0xea, 0xe6, 0xc0, 0x71, 0x06, 0x16, 0x6b, 0xeb, 0xae, 0xd9, 0xd6, 0x6d, 0xdb, 0x09, - 0xf4, 0xc0, 0x74, 0x6c, 0x5f, 0x70, 0xe9, 0x6b, 0xa8, 0x1d, 0x07, 0xba, 0x17, 0xfc, 0x55, 0xf7, - 0xcf, 0x34, 0xf6, 0x66, 0xc4, 0xfc, 0x80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 0xb3, 0xcd, 0x0e, 0x3c, - 0xb4, 0x85, 0x18, 0x4d, 0xd2, 0xc8, 0xb7, 0x8b, 0xf4, 0xc7, 0x11, 0xc7, 0x81, 0x20, 0x19, 0xf1, - 0xf8, 0x44, 0x93, 0x8c, 0x78, 0x62, 0x7a, 0xa0, 0x5b, 0x88, 0xa2, 0xaa, 0xab, 0xe9, 0x88, 0xe3, - 0x35, 0x6e, 0x84, 0x05, 0x8b, 0x89, 0xae, 0x2e, 0x70, 0xf2, 0x86, 0x02, 0x81, 0x93, 0x3b, 0x02, - 0x84, 0x95, 0x8e, 0xb4, 0xd2, 0x38, 0xa3, 0x6e, 0xbc, 0xd8, 0x91, 0xd7, 0x00, 0xe3, 0x1e, 0x2e, - 0x5c, 0x96, 0x69, 0xfe, 0xc2, 0x65, 0xd9, 0x56, 0x4f, 0x7f, 0x83, 0x20, 0x37, 0xc9, 0x55, 0xe5, - 0x94, 0xbc, 0x86, 0x6a, 0xac, 0x7f, 0x8a, 0x9a, 0x9d, 0xed, 0xf1, 0xa2, 0x66, 0xe7, 0x34, 0xda, - 0x89, 0x1e, 0x63, 0xfc, 0x16, 0xff, 0x44, 0x1e, 0x37, 0xbf, 0xfd, 0xd8, 0x52, 0x3e, 0x7c, 0x6c, - 0x29, 0x3f, 0x7c, 0x6c, 0x29, 0xff, 0xfd, 0xd4, 0x2a, 0x7c, 0xf8, 0xd4, 0x2a, 0x7c, 0xff, 0xa9, - 0x55, 0xe8, 0xce, 0xe2, 0x9f, 0xfe, 0xdf, 0xff, 0x1c, 0x00, 0x00, 0xff, 0xff, 0x44, 0xe7, 0x99, - 0xfa, 0x2d, 0x18, 0x00, 0x00, + // 1873 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x59, 0x4f, 0x6f, 0xdb, 0xc8, + 0x15, 0x17, 0x25, 0xc5, 0x96, 0x9f, 0x6c, 0xaf, 0x3c,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x7a, 0xb5, 0xef, 0xdf, 0xf5, 0x6a, 0xff, 0x7c, 0xd7, 0xab, 0x8d, 0x56, 0xf0, + 0x6f, 0x8d, 0x1f, 0xfd, 0x27, 0x00, 0x00, 0xff, 0xff, 0xf5, 0xb6, 0xf4, 0x66, 0x1a, 0x19, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2914,9 +3044,10 @@ type MasterClient interface { ListMember(ctx context.Context, in *ListMemberRequest, opts ...grpc.CallOption) (*ListMemberResponse, error) OperateSchema(ctx context.Context, in *OperateSchemaRequest, opts ...grpc.CallOption) (*OperateSchemaResponse, error) GetSubTaskCfg(ctx context.Context, in *GetSubTaskCfgRequest, opts ...grpc.CallOption) (*GetSubTaskCfgResponse, error) - // GetTaskCfg get task config - GetTaskCfg(ctx context.Context, in *GetTaskCfgRequest, opts ...grpc.CallOption) (*GetTaskCfgResponse, error) + // GetCfg get config + GetCfg(ctx context.Context, in *GetCfgRequest, opts ...grpc.CallOption) (*GetCfgResponse, error) HandleError(ctx context.Context, in *HandleErrorRequest, opts ...grpc.CallOption) (*HandleErrorResponse, error) + GetMasterCfg(ctx context.Context, in *GetMasterCfgRequest, opts ...grpc.CallOption) (*GetMasterCfgResponse, error) } type masterClient struct { @@ -3071,9 +3202,9 @@ func (c *masterClient) GetSubTaskCfg(ctx context.Context, in *GetSubTaskCfgReque return out, nil } -func (c *masterClient) GetTaskCfg(ctx context.Context, in *GetTaskCfgRequest, opts ...grpc.CallOption) (*GetTaskCfgResponse, error) { - out := new(GetTaskCfgResponse) - err := c.cc.Invoke(ctx, "/pb.Master/GetTaskCfg", in, out, opts...) +func (c *masterClient) GetCfg(ctx context.Context, in *GetCfgRequest, opts ...grpc.CallOption) (*GetCfgResponse, error) { + out := new(GetCfgResponse) + err := c.cc.Invoke(ctx, "/pb.Master/GetCfg", in, out, opts...) if err != nil { return nil, err } @@ -3089,6 +3220,15 @@ func (c *masterClient) HandleError(ctx context.Context, in *HandleErrorRequest, return out, nil } +func (c *masterClient) GetMasterCfg(ctx context.Context, in *GetMasterCfgRequest, opts ...grpc.CallOption) (*GetMasterCfgResponse, error) { + out := new(GetMasterCfgResponse) + err := c.cc.Invoke(ctx, "/pb.Master/GetMasterCfg", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MasterServer is the server API for Master service. type MasterServer interface { StartTask(context.Context, *StartTaskRequest) (*StartTaskResponse, error) @@ -3119,9 +3259,10 @@ type MasterServer interface { ListMember(context.Context, *ListMemberRequest) (*ListMemberResponse, error) OperateSchema(context.Context, *OperateSchemaRequest) (*OperateSchemaResponse, error) GetSubTaskCfg(context.Context, *GetSubTaskCfgRequest) (*GetSubTaskCfgResponse, error) - // GetTaskCfg get task config - GetTaskCfg(context.Context, *GetTaskCfgRequest) (*GetTaskCfgResponse, error) + // GetCfg get config + GetCfg(context.Context, *GetCfgRequest) (*GetCfgResponse, error) HandleError(context.Context, *HandleErrorRequest) (*HandleErrorResponse, error) + GetMasterCfg(context.Context, *GetMasterCfgRequest) (*GetMasterCfgResponse, error) } // UnimplementedMasterServer can be embedded to have forward compatible implementations. @@ -3176,12 +3317,15 @@ func (*UnimplementedMasterServer) OperateSchema(ctx context.Context, req *Operat func (*UnimplementedMasterServer) GetSubTaskCfg(ctx context.Context, req *GetSubTaskCfgRequest) (*GetSubTaskCfgResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetSubTaskCfg not implemented") } -func (*UnimplementedMasterServer) GetTaskCfg(ctx context.Context, req *GetTaskCfgRequest) (*GetTaskCfgResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetTaskCfg not implemented") +func (*UnimplementedMasterServer) GetCfg(ctx context.Context, req *GetCfgRequest) (*GetCfgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetCfg not implemented") } func (*UnimplementedMasterServer) HandleError(ctx context.Context, req *HandleErrorRequest) (*HandleErrorResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method HandleError not implemented") } +func (*UnimplementedMasterServer) GetMasterCfg(ctx context.Context, req *GetMasterCfgRequest) (*GetMasterCfgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetMasterCfg not implemented") +} func RegisterMasterServer(s *grpc.Server, srv MasterServer) { s.RegisterService(&_Master_serviceDesc, srv) @@ -3475,20 +3619,20 @@ func _Master_GetSubTaskCfg_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } -func _Master_GetTaskCfg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetTaskCfgRequest) +func _Master_GetCfg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetCfgRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(MasterServer).GetTaskCfg(ctx, in) + return srv.(MasterServer).GetCfg(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.Master/GetTaskCfg", + FullMethod: "/pb.Master/GetCfg", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MasterServer).GetTaskCfg(ctx, req.(*GetTaskCfgRequest)) + return srv.(MasterServer).GetCfg(ctx, req.(*GetCfgRequest)) } return interceptor(ctx, in, info, handler) } @@ -3511,6 +3655,24 @@ func _Master_HandleError_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Master_GetMasterCfg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetMasterCfgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MasterServer).GetMasterCfg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Master/GetMasterCfg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MasterServer).GetMasterCfg(ctx, req.(*GetMasterCfgRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Master_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.Master", HandlerType: (*MasterServer)(nil), @@ -3580,13 +3742,17 @@ var _Master_serviceDesc = grpc.ServiceDesc{ Handler: _Master_GetSubTaskCfg_Handler, }, { - MethodName: "GetTaskCfg", - Handler: _Master_GetTaskCfg_Handler, + MethodName: "GetCfg", + Handler: _Master_GetCfg_Handler, }, { MethodName: "HandleError", Handler: _Master_HandleError_Handler, }, + { + MethodName: "GetMasterCfg", + Handler: _Master_GetMasterCfg_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dmmaster.proto", @@ -5500,7 +5666,7 @@ func (m *GetSubTaskCfgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GetTaskCfgRequest) Marshal() (dAtA []byte, err error) { +func (m *GetCfgRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5510,12 +5676,12 @@ func (m *GetTaskCfgRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetTaskCfgRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *GetCfgRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetTaskCfgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetCfgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5525,12 +5691,17 @@ func (m *GetTaskCfgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { copy(dAtA[i:], m.Name) i = encodeVarintDmmaster(dAtA, i, uint64(len(m.Name))) i-- - dAtA[i] = 0xa + dAtA[i] = 0x12 + } + if m.Type != 0 { + i = encodeVarintDmmaster(dAtA, i, uint64(m.Type)) + i-- + dAtA[i] = 0x8 } return len(dAtA) - i, nil } -func (m *GetTaskCfgResponse) Marshal() (dAtA []byte, err error) { +func (m *GetCfgResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -5540,12 +5711,12 @@ func (m *GetTaskCfgResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GetTaskCfgResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *GetCfgResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GetTaskCfgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *GetCfgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -5577,6 +5748,59 @@ func (m *GetTaskCfgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *GetMasterCfgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetMasterCfgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMasterCfgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetMasterCfgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetMasterCfgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetMasterCfgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cfg) > 0 { + i -= len(m.Cfg) + copy(dAtA[i:], m.Cfg) + i = encodeVarintDmmaster(dAtA, i, uint64(len(m.Cfg))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *HandleErrorRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -6558,12 +6782,15 @@ func (m *GetSubTaskCfgResponse) Size() (n int) { return n } -func (m *GetTaskCfgRequest) Size() (n int) { +func (m *GetCfgRequest) Size() (n int) { if m == nil { return 0 } var l int _ = l + if m.Type != 0 { + n += 1 + sovDmmaster(uint64(m.Type)) + } l = len(m.Name) if l > 0 { n += 1 + l + sovDmmaster(uint64(l)) @@ -6571,7 +6798,7 @@ func (m *GetTaskCfgRequest) Size() (n int) { return n } -func (m *GetTaskCfgResponse) Size() (n int) { +func (m *GetCfgResponse) Size() (n int) { if m == nil { return 0 } @@ -6591,6 +6818,28 @@ func (m *GetTaskCfgResponse) Size() (n int) { return n } +func (m *GetMasterCfgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetMasterCfgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cfg) + if l > 0 { + n += 1 + l + sovDmmaster(uint64(l)) + } + return n +} + func (m *HandleErrorRequest) Size() (n int) { if m == nil { return 0 @@ -11974,7 +12223,7 @@ func (m *GetSubTaskCfgResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetTaskCfgRequest) Unmarshal(dAtA []byte) error { +func (m *GetCfgRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -11997,13 +12246,32 @@ func (m *GetTaskCfgRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetTaskCfgRequest: wiretype end group for non-group") + return fmt.Errorf("proto: GetCfgRequest: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetTaskCfgRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetCfgRequest: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + m.Type = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmmaster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Type |= CfgType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) } @@ -12059,7 +12327,7 @@ func (m *GetTaskCfgRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *GetTaskCfgResponse) Unmarshal(dAtA []byte) error { +func (m *GetCfgResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -12082,10 +12350,10 @@ func (m *GetTaskCfgResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GetTaskCfgResponse: wiretype end group for non-group") + return fmt.Errorf("proto: GetCfgResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GetTaskCfgResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: GetCfgResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -12196,6 +12464,144 @@ func (m *GetTaskCfgResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *GetMasterCfgRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmmaster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetMasterCfgRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetMasterCfgRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipDmmaster(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDmmaster + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDmmaster + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetMasterCfgResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmmaster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetMasterCfgResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetMasterCfgResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cfg", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmmaster + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDmmaster + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDmmaster + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cfg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDmmaster(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDmmaster + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDmmaster + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *HandleErrorRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/dm/pb/dmmaster.pb.gw.go b/dm/pb/dmmaster.pb.gw.go index 2b77fd8033..f2a0625595 100644 --- a/dm/pb/dmmaster.pb.gw.go +++ b/dm/pb/dmmaster.pb.gw.go @@ -511,8 +511,12 @@ func local_request_Master_GetSubTaskCfg_0(ctx context.Context, marshaler runtime } -func request_Master_GetTaskCfg_0(ctx context.Context, marshaler runtime.Marshaler, client MasterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetTaskCfgRequest +var ( + filter_Master_GetCfg_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Master_GetCfg_0(ctx context.Context, marshaler runtime.Marshaler, client MasterClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCfgRequest var metadata runtime.ServerMetadata var ( @@ -533,13 +537,20 @@ func request_Master_GetTaskCfg_0(ctx context.Context, marshaler runtime.Marshale return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := client.GetTaskCfg(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Master_GetCfg_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetCfg(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Master_GetTaskCfg_0(ctx context.Context, marshaler runtime.Marshaler, server MasterServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq GetTaskCfgRequest +func local_request_Master_GetCfg_0(ctx context.Context, marshaler runtime.Marshaler, server MasterServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetCfgRequest var metadata runtime.ServerMetadata var ( @@ -560,7 +571,11 @@ func local_request_Master_GetTaskCfg_0(ctx context.Context, marshaler runtime.Ma return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } - msg, err := server.GetTaskCfg(ctx, &protoReq) + if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Master_GetCfg_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetCfg(ctx, &protoReq) return msg, metadata, err } @@ -784,7 +799,7 @@ func RegisterMasterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser }) - mux.Handle("GET", pattern_Master_GetTaskCfg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Master_GetCfg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -793,14 +808,14 @@ func RegisterMasterHandlerServer(ctx context.Context, mux *runtime.ServeMux, ser runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Master_GetTaskCfg_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Master_GetCfg_0(rctx, inboundMarshaler, server, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Master_GetTaskCfg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Master_GetCfg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1045,7 +1060,7 @@ func RegisterMasterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli }) - mux.Handle("GET", pattern_Master_GetTaskCfg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Master_GetCfg_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) @@ -1054,14 +1069,14 @@ func RegisterMasterHandlerClient(ctx context.Context, mux *runtime.ServeMux, cli runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Master_GetTaskCfg_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Master_GetCfg_0(rctx, inboundMarshaler, client, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Master_GetTaskCfg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Master_GetCfg_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -1107,7 +1122,7 @@ var ( pattern_Master_GetSubTaskCfg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1alpha1", "subtasks", "name"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Master_GetTaskCfg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1alpha1", "tasks", "name"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Master_GetCfg_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"apis", "v1alpha1", "tasks", "name"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Master_HandleError_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1alpha1", "errors"}, "", runtime.AssumeColonVerbOpt(true))) ) @@ -1131,7 +1146,7 @@ var ( forward_Master_GetSubTaskCfg_0 = runtime.ForwardResponseMessage - forward_Master_GetTaskCfg_0 = runtime.ForwardResponseMessage + forward_Master_GetCfg_0 = runtime.ForwardResponseMessage forward_Master_HandleError_0 = runtime.ForwardResponseMessage ) diff --git a/dm/pb/dmworker.pb.go b/dm/pb/dmworker.pb.go index 3809c12128..384947fcdf 100644 --- a/dm/pb/dmworker.pb.go +++ b/dm/pb/dmworker.pb.go @@ -2376,6 +2376,86 @@ func (m *HandleWorkerErrorRequest) GetSqls() []string { return nil } +type GetWorkerCfgRequest struct { +} + +func (m *GetWorkerCfgRequest) Reset() { *m = GetWorkerCfgRequest{} } +func (m *GetWorkerCfgRequest) String() string { return proto.CompactTextString(m) } +func (*GetWorkerCfgRequest) ProtoMessage() {} +func (*GetWorkerCfgRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_51a1b9e17fd67b10, []int{29} +} +func (m *GetWorkerCfgRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetWorkerCfgRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetWorkerCfgRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetWorkerCfgRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetWorkerCfgRequest.Merge(m, src) +} +func (m *GetWorkerCfgRequest) XXX_Size() int { + return m.Size() +} +func (m *GetWorkerCfgRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetWorkerCfgRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetWorkerCfgRequest proto.InternalMessageInfo + +type GetWorkerCfgResponse struct { + Cfg string `protobuf:"bytes,1,opt,name=cfg,proto3" json:"cfg,omitempty"` +} + +func (m *GetWorkerCfgResponse) Reset() { *m = GetWorkerCfgResponse{} } +func (m *GetWorkerCfgResponse) String() string { return proto.CompactTextString(m) } +func (*GetWorkerCfgResponse) ProtoMessage() {} +func (*GetWorkerCfgResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_51a1b9e17fd67b10, []int{30} +} +func (m *GetWorkerCfgResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetWorkerCfgResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetWorkerCfgResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GetWorkerCfgResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetWorkerCfgResponse.Merge(m, src) +} +func (m *GetWorkerCfgResponse) XXX_Size() int { + return m.Size() +} +func (m *GetWorkerCfgResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetWorkerCfgResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetWorkerCfgResponse proto.InternalMessageInfo + +func (m *GetWorkerCfgResponse) GetCfg() string { + if m != nil { + return m.Cfg + } + return "" +} + func init() { proto.RegisterEnum("pb.TaskOp", TaskOp_name, TaskOp_value) proto.RegisterEnum("pb.Stage", Stage_name, Stage_value) @@ -2414,11 +2494,14 @@ func init() { proto.RegisterType((*OperateV1MetaResponse)(nil), "pb.OperateV1MetaResponse") proto.RegisterMapType((map[string]*V1SubTaskMeta)(nil), "pb.OperateV1MetaResponse.MetaEntry") proto.RegisterType((*HandleWorkerErrorRequest)(nil), "pb.HandleWorkerErrorRequest") + proto.RegisterType((*GetWorkerCfgRequest)(nil), "pb.GetWorkerCfgRequest") + proto.RegisterType((*GetWorkerCfgResponse)(nil), "pb.GetWorkerCfgResponse") } func init() { proto.RegisterFile("dmworker.proto", fileDescriptor_51a1b9e17fd67b10) } var fileDescriptor_51a1b9e17fd67b10 = []byte{ +<<<<<<< HEAD // 1907 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x41, 0x93, 0xdb, 0x58, 0x11, 0xb6, 0x24, 0xdb, 0x63, 0xb7, 0xed, 0x89, 0xf2, 0x92, 0x5d, 0xcc, 0x10, 0xcc, 0x94, 0xb2, @@ -2540,6 +2623,132 @@ var fileDescriptor_51a1b9e17fd67b10 = []byte{ 0xd5, 0xc4, 0xfa, 0xed, 0xeb, 0x49, 0xeb, 0xab, 0xd7, 0x93, 0xd6, 0x3f, 0x5f, 0x4f, 0x5a, 0xf3, 0x2e, 0xfd, 0xcc, 0xfb, 0xde, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xc2, 0x78, 0xee, 0x8f, 0xde, 0x13, 0x00, 0x00, +======= + // 1962 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4f, 0x73, 0xdc, 0x4a, + 0x11, 0x5f, 0xad, 0x76, 0xd7, 0xbb, 0xbd, 0x6b, 0x47, 0x99, 0x38, 0x8f, 0xc5, 0x84, 0xc5, 0xa5, + 0xbc, 0x0a, 0xc6, 0x07, 0x17, 0x31, 0x8f, 0x7a, 0xd4, 0xab, 0x02, 0x42, 0xec, 0x3c, 0xe7, 0x81, + 0x83, 0x13, 0x39, 0x79, 0x1c, 0xa9, 0x59, 0x69, 0xbc, 0x56, 0x59, 0x2b, 0x29, 0xd2, 0xc8, 0xae, + 0x3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5b, 0xec, 0x08, 0x86, 0xaa, + 0x57, 0xa8, 0xf9, 0x7c, 0x0f, 0x65, 0x57, 0x35, 0x8f, 0x77, 0x3a, 0x74, 0x00, 0x23, 0xb3, 0xbc, + 0x19, 0x45, 0x72, 0x49, 0x1f, 0x50, 0x4a, 0x96, 0x75, 0x02, 0xb7, 0xf5, 0x78, 0xfc, 0x8f, 0x37, + 0x13, 0xeb, 0xeb, 0x37, 0x13, 0xeb, 0xdf, 0x6f, 0x26, 0xd6, 0xef, 0xde, 0x4e, 0x5a, 0x5f, 0xbf, + 0x9d, 0xb4, 0xfe, 0xf5, 0x76, 0xd2, 0x9a, 0xf6, 0xe8, 0xd7, 0xe3, 0x0f, 0xfe, 0x1b, 0x00, 0x00, + 0xff, 0xff, 0x8b, 0xc0, 0x89, 0xd7, 0x8c, 0x14, 0x00, 0x00, +>>>>>>> e7915941... feat: add get-config command (#1323) } // Reference imports to suppress errors if they are not otherwise used. @@ -2563,6 +2772,7 @@ type WorkerClient interface { OperateSchema(ctx context.Context, in *OperateWorkerSchemaRequest, opts ...grpc.CallOption) (*CommonWorkerResponse, error) OperateV1Meta(ctx context.Context, in *OperateV1MetaRequest, opts ...grpc.CallOption) (*OperateV1MetaResponse, error) HandleError(ctx context.Context, in *HandleWorkerErrorRequest, opts ...grpc.CallOption) (*CommonWorkerResponse, error) + GetWorkerCfg(ctx context.Context, in *GetWorkerCfgRequest, opts ...grpc.CallOption) (*GetWorkerCfgResponse, error) } type workerClient struct { @@ -2618,6 +2828,15 @@ func (c *workerClient) HandleError(ctx context.Context, in *HandleWorkerErrorReq return out, nil } +func (c *workerClient) GetWorkerCfg(ctx context.Context, in *GetWorkerCfgRequest, opts ...grpc.CallOption) (*GetWorkerCfgResponse, error) { + out := new(GetWorkerCfgResponse) + err := c.cc.Invoke(ctx, "/pb.Worker/GetWorkerCfg", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // WorkerServer is the server API for Worker service. type WorkerServer interface { QueryStatus(context.Context, *QueryStatusRequest) (*QueryStatusResponse, error) @@ -2629,6 +2848,7 @@ type WorkerServer interface { OperateSchema(context.Context, *OperateWorkerSchemaRequest) (*CommonWorkerResponse, error) OperateV1Meta(context.Context, *OperateV1MetaRequest) (*OperateV1MetaResponse, error) HandleError(context.Context, *HandleWorkerErrorRequest) (*CommonWorkerResponse, error) + GetWorkerCfg(context.Context, *GetWorkerCfgRequest) (*GetWorkerCfgResponse, error) } // UnimplementedWorkerServer can be embedded to have forward compatible implementations. @@ -2650,6 +2870,9 @@ func (*UnimplementedWorkerServer) OperateV1Meta(ctx context.Context, req *Operat func (*UnimplementedWorkerServer) HandleError(ctx context.Context, req *HandleWorkerErrorRequest) (*CommonWorkerResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method HandleError not implemented") } +func (*UnimplementedWorkerServer) GetWorkerCfg(ctx context.Context, req *GetWorkerCfgRequest) (*GetWorkerCfgResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetWorkerCfg not implemented") +} func RegisterWorkerServer(s *grpc.Server, srv WorkerServer) { s.RegisterService(&_Worker_serviceDesc, srv) @@ -2745,6 +2968,24 @@ func _Worker_HandleError_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Worker_GetWorkerCfg_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetWorkerCfgRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WorkerServer).GetWorkerCfg(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.Worker/GetWorkerCfg", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WorkerServer).GetWorkerCfg(ctx, req.(*GetWorkerCfgRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Worker_serviceDesc = grpc.ServiceDesc{ ServiceName: "pb.Worker", HandlerType: (*WorkerServer)(nil), @@ -2769,6 +3010,10 @@ var _Worker_serviceDesc = grpc.ServiceDesc{ MethodName: "HandleError", Handler: _Worker_HandleError_Handler, }, + { + MethodName: "GetWorkerCfg", + Handler: _Worker_GetWorkerCfg_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "dmworker.proto", @@ -4445,6 +4690,59 @@ func (m *HandleWorkerErrorRequest) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *GetWorkerCfgRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetWorkerCfgRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetWorkerCfgRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetWorkerCfgResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GetWorkerCfgResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetWorkerCfgResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Cfg) > 0 { + i -= len(m.Cfg) + copy(dAtA[i:], m.Cfg) + i = encodeVarintDmworker(dAtA, i, uint64(len(m.Cfg))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintDmworker(dAtA []byte, offset int, v uint64) int { offset -= sovDmworker(v) base := offset @@ -5245,6 +5543,28 @@ func (m *HandleWorkerErrorRequest) Size() (n int) { return n } +func (m *GetWorkerCfgRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetWorkerCfgResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Cfg) + if l > 0 { + n += 1 + l + sovDmworker(uint64(l)) + } + return n +} + func sovDmworker(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -10134,6 +10454,144 @@ func (m *HandleWorkerErrorRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *GetWorkerCfgRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmworker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetWorkerCfgRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetWorkerCfgRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipDmworker(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDmworker + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDmworker + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetWorkerCfgResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmworker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GetWorkerCfgResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetWorkerCfgResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cfg", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDmworker + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDmworker + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDmworker + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cfg = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDmworker(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthDmworker + } + if (iNdEx + skippy) < 0 { + return ErrInvalidLengthDmworker + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipDmworker(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/dm/pbmock/dmmaster.go b/dm/pbmock/dmmaster.go index fa46d10b86..b5d3c4885f 100644 --- a/dm/pbmock/dmmaster.go +++ b/dm/pbmock/dmmaster.go @@ -55,44 +55,64 @@ func (mr *MockMasterClientMockRecorder) CheckTask(arg0, arg1 interface{}, arg2 . return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckTask", reflect.TypeOf((*MockMasterClient)(nil).CheckTask), varargs...) } -// GetSubTaskCfg mocks base method -func (m *MockMasterClient) GetSubTaskCfg(arg0 context.Context, arg1 *pb.GetSubTaskCfgRequest, arg2 ...grpc.CallOption) (*pb.GetSubTaskCfgResponse, error) { +// 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} for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetSubTaskCfg", varargs...) - ret0, _ := ret[0].(*pb.GetSubTaskCfgResponse) + ret := m.ctrl.Call(m, "GetCfg", varargs...) + ret0, _ := ret[0].(*pb.GetCfgResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSubTaskCfg indicates an expected call of GetSubTaskCfg -func (mr *MockMasterClientMockRecorder) GetSubTaskCfg(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +// 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, "GetSubTaskCfg", reflect.TypeOf((*MockMasterClient)(nil).GetSubTaskCfg), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCfg", reflect.TypeOf((*MockMasterClient)(nil).GetCfg), varargs...) } -// GetTaskCfg mocks base method -func (m *MockMasterClient) GetTaskCfg(arg0 context.Context, arg1 *pb.GetTaskCfgRequest, arg2 ...grpc.CallOption) (*pb.GetTaskCfgResponse, error) { +// 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} for _, a := range arg2 { varargs = append(varargs, a) } - ret := m.ctrl.Call(m, "GetTaskCfg", varargs...) - ret0, _ := ret[0].(*pb.GetTaskCfgResponse) + ret := m.ctrl.Call(m, "GetMasterCfg", varargs...) + ret0, _ := ret[0].(*pb.GetMasterCfgResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetTaskCfg indicates an expected call of GetTaskCfg -func (mr *MockMasterClientMockRecorder) GetTaskCfg(arg0, arg1 interface{}, arg2 ...interface{}) *gomock.Call { +// 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, "GetTaskCfg", reflect.TypeOf((*MockMasterClient)(nil).GetTaskCfg), varargs...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetMasterCfg", reflect.TypeOf((*MockMasterClient)(nil).GetMasterCfg), varargs...) +} + +// 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} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetSubTaskCfg", varargs...) + ret0, _ := ret[0].(*pb.GetSubTaskCfgResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// 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 @@ -433,34 +453,49 @@ func (mr *MockMasterServerMockRecorder) CheckTask(arg0, arg1 interface{}) *gomoc return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CheckTask", reflect.TypeOf((*MockMasterServer)(nil).CheckTask), arg0, arg1) } -// GetSubTaskCfg mocks base method -func (m *MockMasterServer) GetSubTaskCfg(arg0 context.Context, arg1 *pb.GetSubTaskCfgRequest) (*pb.GetSubTaskCfgResponse, error) { +// 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, "GetSubTaskCfg", arg0, arg1) - ret0, _ := ret[0].(*pb.GetSubTaskCfgResponse) + ret := m.ctrl.Call(m, "GetCfg", arg0, arg1) + ret0, _ := ret[0].(*pb.GetCfgResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetSubTaskCfg indicates an expected call of GetSubTaskCfg -func (mr *MockMasterServerMockRecorder) GetSubTaskCfg(arg0, arg1 interface{}) *gomock.Call { +// 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, "GetSubTaskCfg", reflect.TypeOf((*MockMasterServer)(nil).GetSubTaskCfg), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetCfg", reflect.TypeOf((*MockMasterServer)(nil).GetCfg), arg0, arg1) +} + +// 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) + ret0, _ := ret[0].(*pb.GetMasterCfgResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// 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) } -// GetTaskCfg mocks base method -func (m *MockMasterServer) GetTaskCfg(arg0 context.Context, arg1 *pb.GetTaskCfgRequest) (*pb.GetTaskCfgResponse, error) { +// 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, "GetTaskCfg", arg0, arg1) - ret0, _ := ret[0].(*pb.GetTaskCfgResponse) + ret := m.ctrl.Call(m, "GetSubTaskCfg", arg0, arg1) + ret0, _ := ret[0].(*pb.GetSubTaskCfgResponse) ret1, _ := ret[1].(error) return ret0, ret1 } -// GetTaskCfg indicates an expected call of GetTaskCfg -func (mr *MockMasterServerMockRecorder) GetTaskCfg(arg0, arg1 interface{}) *gomock.Call { +// 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, "GetTaskCfg", reflect.TypeOf((*MockMasterServer)(nil).GetTaskCfg), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetSubTaskCfg", reflect.TypeOf((*MockMasterServer)(nil).GetSubTaskCfg), arg0, arg1) } // HandleError mocks base method diff --git a/dm/pbmock/dmworker.go b/dm/pbmock/dmworker.go index b36b1666a5..fa4f3de7a3 100644 --- a/dm/pbmock/dmworker.go +++ b/dm/pbmock/dmworker.go @@ -35,6 +35,26 @@ func (m *MockWorkerClient) EXPECT() *MockWorkerClientMockRecorder { return m.recorder } +// 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} + for _, a := range arg2 { + varargs = append(varargs, a) + } + ret := m.ctrl.Call(m, "GetWorkerCfg", varargs...) + ret0, _ := ret[0].(*pb.GetWorkerCfgResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// 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 func (m *MockWorkerClient) HandleError(arg0 context.Context, arg1 *pb.HandleWorkerErrorRequest, arg2 ...grpc.CallOption) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() @@ -158,6 +178,21 @@ func (m *MockWorkerServer) EXPECT() *MockWorkerServerMockRecorder { return m.recorder } +// 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) + ret0, _ := ret[0].(*pb.GetWorkerCfgResponse) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// 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 func (m *MockWorkerServer) HandleError(arg0 context.Context, arg1 *pb.HandleWorkerErrorRequest) (*pb.CommonWorkerResponse, error) { m.ctrl.T.Helper() diff --git a/dm/proto/dmmaster.proto b/dm/proto/dmmaster.proto index 4633baf20d..6b2a7746ea 100644 --- a/dm/proto/dmmaster.proto +++ b/dm/proto/dmmaster.proto @@ -89,8 +89,8 @@ service Master { }; } - // GetTaskCfg get task config - rpc GetTaskCfg(GetTaskCfgRequest) returns(GetTaskCfgResponse) { + // GetCfg get config + rpc GetCfg(GetCfgRequest) returns(GetCfgResponse) { option (google.api.http) = { get: "/apis/v1alpha1/tasks/{name}" }; @@ -102,6 +102,8 @@ service Master { body: "*" }; } + + rpc GetMasterCfg(GetMasterCfgRequest) returns(GetMasterCfgResponse) {} } message StartTaskRequest { @@ -383,17 +385,32 @@ message GetSubTaskCfgResponse { repeated string cfgs = 3; } -message GetTaskCfgRequest { - // the task name - string name = 1; +enum CfgType { + InvalidType = 0; + TaskType = 1; + MasterType = 2; + WorkerType = 3; + SourceType = 4; +} + +message GetCfgRequest { + CfgType type = 1; // the config type + string name = 2; // the config name } -message GetTaskCfgResponse { +message GetCfgResponse { bool result = 1; string msg = 2; string cfg = 3; } +message GetMasterCfgRequest { +} + +message GetMasterCfgResponse { + string cfg = 1; +} + message HandleErrorRequest { ErrorOp op = 1; // operation type string task = 2; // the task name diff --git a/dm/proto/dmworker.proto b/dm/proto/dmworker.proto index 91c31c3f4c..591a35846f 100644 --- a/dm/proto/dmworker.proto +++ b/dm/proto/dmworker.proto @@ -17,6 +17,8 @@ service Worker { rpc OperateV1Meta(OperateV1MetaRequest) returns(OperateV1MetaResponse) {} rpc HandleError(HandleWorkerErrorRequest) returns(CommonWorkerResponse) {} + + rpc GetWorkerCfg(GetWorkerCfgRequest) returns(GetWorkerCfgResponse) {} } enum TaskOp { @@ -358,4 +360,11 @@ message HandleWorkerErrorRequest { string task = 2; // task name string binlogPos = 3; // binlog-pos (that's file:pos format) repeated string sqls = 4; // sqls (use for replace) +} + +message GetWorkerCfgRequest { +} + +message GetWorkerCfgResponse { + string cfg = 1; } \ No newline at end of file diff --git a/dm/worker/config.go b/dm/worker/config.go index 8de442423b..22778d9074 100644 --- a/dm/worker/config.go +++ b/dm/worker/config.go @@ -78,7 +78,7 @@ type Config struct { WorkerAddr string `toml:"worker-addr" json:"worker-addr"` AdvertiseAddr string `toml:"advertise-addr" json:"advertise-addr"` - ConfigFile string `json:"config-file"` + ConfigFile string `toml:"config-file" json:"config-file"` // TODO: in the future dm-workers should share a same ttl from dm-master KeepAliveTTL int64 `toml:"keepalive-ttl" json:"keepalive-ttl"` diff --git a/dm/worker/relay.go b/dm/worker/relay.go index cad64392de..d70b051a57 100644 --- a/dm/worker/relay.go +++ b/dm/worker/relay.go @@ -251,11 +251,12 @@ func (h *realRelayHolder) resumeRelay(ctx context.Context, op pb.RelayOp) error func (h *realRelayHolder) stopRelay(ctx context.Context, op pb.RelayOp) error { h.Lock() - defer h.Unlock() if h.stage == pb.Stage_Stopped { + h.Unlock() return terror.ErrWorkerRelayStageNotValid.Generatef("current stage is already stopped not valid, relayop %s", op) } h.stage = pb.Stage_Stopped + h.Unlock() // unlock to make `run` can return // now, when try to stop relay unit, we close relay holder h.Close() diff --git a/dm/worker/server.go b/dm/worker/server.go index c07a67b19a..ff6fb97cc1 100644 --- a/dm/worker/server.go +++ b/dm/worker/server.go @@ -776,3 +776,13 @@ func (s *Server) HandleError(ctx context.Context, req *pb.HandleWorkerErrorReque Worker: s.cfg.Name, }, nil } + +// GetWorkerCfg get worker config +func (s *Server) GetWorkerCfg(ctx context.Context, req *pb.GetWorkerCfgRequest) (*pb.GetWorkerCfgResponse, error) { + log.L().Info("", zap.String("request", "GetWorkerCfg"), zap.Stringer("payload", req)) + var err error + resp := &pb.GetWorkerCfgResponse{} + + resp.Cfg, err = s.cfg.Toml() + return resp, err +} diff --git a/pkg/ha/task.go b/pkg/ha/task.go deleted file mode 100644 index 2d3203a127..0000000000 --- a/pkg/ha/task.go +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright 2020 PingCAP, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package ha - -import ( - "context" - - "go.etcd.io/etcd/clientv3" - - "github.com/pingcap/dm/dm/common" - "github.com/pingcap/dm/pkg/etcdutil" - "github.com/pingcap/dm/pkg/terror" -) - -func taskCfgFromResp(task string, resp *clientv3.GetResponse) (map[string]string, error) { - tcm := make(map[string]string) - if resp.Count == 0 { - return tcm, nil - } else if task != "" && resp.Count > 1 { - // this should not happen. - return tcm, terror.ErrConfigMoreThanOne.Generate(resp.Count, "task", "task name: "+task) - } - - for _, kvs := range resp.Kvs { - keys, err := common.TaskConfigKeyAdapter.Decode(string(kvs.Key)) - if err != nil { - return tcm, err - } - tcm[keys[0]] = string(kvs.Value) - } - return tcm, nil -} - -// PutTaskCfg puts the config string of task into etcd. -// k/v: task name -> task config string. -func PutTaskCfg(cli *clientv3.Client, task string, cfg string) (int64, error) { - key := common.TaskConfigKeyAdapter.Encode(task) - _, rev, err := etcdutil.DoOpsInOneTxnWithRetry(cli, clientv3.OpPut(key, cfg)) - return rev, err -} - -// GetTaskCfg gets the config string of task. -// k/v: task name -> task config string. -// if the task name is "", it will return all task configs as a map{task-name: task-config-string}. -// if the task name is given, it will return a map{task-name: task-config-string} whose length is 1. -func GetTaskCfg(cli *clientv3.Client, task string) (map[string]string, int64, error) { - ctx, cancel := context.WithTimeout(cli.Ctx(), etcdutil.DefaultRequestTimeout) - defer cancel() - - var ( - tcm = make(map[string]string) - resp *clientv3.GetResponse - err error - ) - if task != "" { - resp, err = cli.Get(ctx, common.TaskConfigKeyAdapter.Encode(task)) - } else { - resp, err = cli.Get(ctx, common.TaskConfigKeyAdapter.Path(), clientv3.WithPrefix()) - } - - if err != nil { - return tcm, 0, err - } - - tcm, err = taskCfgFromResp(task, resp) - if err != nil { - return tcm, 0, err - } - - return tcm, resp.Header.Revision, nil -} - -// DeleteTaskCfg deletes the config of task. -func DeleteTaskCfg(cli *clientv3.Client, task string) (int64, error) { - _, rev, err := etcdutil.DoOpsInOneTxnWithRetry(cli, clientv3.OpDelete(common.TaskConfigKeyAdapter.Encode(task))) - return rev, err -} diff --git a/pkg/ha/task_test.go b/pkg/ha/task_test.go deleted file mode 100644 index 90164dd319..0000000000 --- a/pkg/ha/task_test.go +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright 2020 PingCAP, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// See the License for the specific language governing permissions and -// limitations under the License. - -package ha - -import ( - . "github.com/pingcap/check" - - "github.com/pingcap/dm/dm/config" -) - -const ( - // do not forget to update this path if the file removed/renamed. - taskSampleFile = "../../dm/master/task_basic.yaml" -) - -func (t *testForEtcd) TestTaskEtcd(c *C) { - defer clearTestInfoOperation(c) - - cfg1 := config.TaskConfig{} - c.Assert(cfg1.DecodeFile(taskSampleFile), IsNil) - taskName1 := cfg1.Name - - taskName2 := taskName1 + "2" - cfg2 := cfg1 - cfg2.Name = taskName2 - - for _, mysqlInstance := range cfg1.MySQLInstances { - mysqlInstance.RemoveDuplicateCfg() - } - for _, mysqlInstance := range cfg2.MySQLInstances { - mysqlInstance.RemoveDuplicateCfg() - } - cfgStr1 := cfg1.String() - cfgStr2 := cfg2.String() - - // no task config exist. - tcm1, rev1, err := GetTaskCfg(etcdTestCli, taskName1) - c.Assert(err, IsNil) - c.Assert(rev1, Greater, int64(0)) - c.Assert(tcm1, HasLen, 0) - - // put task config 1 - rev2, err := PutTaskCfg(etcdTestCli, taskName1, cfgStr1) - c.Assert(err, IsNil) - c.Assert(rev2, Greater, rev1) - - // put task config 2 - rev3, err := PutTaskCfg(etcdTestCli, taskName2, cfgStr2) - c.Assert(err, IsNil) - c.Assert(rev3, Greater, rev2) - - // get single config back. - tsm2, rev4, err := GetTaskCfg(etcdTestCli, taskName1) - c.Assert(err, IsNil) - c.Assert(rev4, Equals, rev3) - c.Assert(tsm2, HasLen, 1) - c.Assert(tsm2, HasKey, taskName1) - c.Assert(tsm2[taskName1], Equals, cfgStr1) - - tsm3, rev5, err := GetTaskCfg(etcdTestCli, "") - c.Assert(err, IsNil) - c.Assert(rev5, Equals, rev4) - c.Assert(tsm3, HasLen, 2) - c.Assert(tsm3, HasKey, taskName1) - c.Assert(tsm3, HasKey, taskName2) - c.Assert(tsm3[taskName1], DeepEquals, cfgStr1) - c.Assert(tsm3[taskName2], DeepEquals, cfgStr2) - - // delete the config. - rev6, err := DeleteTaskCfg(etcdTestCli, taskName1) - c.Assert(err, IsNil) - c.Assert(rev6, Greater, rev5) - - // get again, not exists now. - tsm4, rev7, err := GetTaskCfg(etcdTestCli, taskName1) - c.Assert(err, IsNil) - c.Assert(tsm4, HasLen, 0) - c.Assert(rev7, Equals, rev6) - - // put task config. - rev8, err := PutTaskCfg(etcdTestCli, taskName1, cfgStr1) - c.Assert(err, IsNil) - c.Assert(rev8, Greater, rev7) - - // update task config. - cfg3 := cfg1 - cfg3.TaskMode = "full" - for _, mysqlInstance := range cfg2.MySQLInstances { - mysqlInstance.RemoveDuplicateCfg() - } - cfgStr3 := cfg3.String() - rev9, err := PutTaskCfg(etcdTestCli, cfg3.Name, cfgStr3) - c.Assert(err, IsNil) - c.Assert(rev9, Greater, rev8) - - // get updated task - tsm5, rev10, err := GetTaskCfg(etcdTestCli, taskName1) - c.Assert(err, IsNil) - c.Assert(rev10, Equals, rev9) - c.Assert(tsm5, HasLen, 1) - c.Assert(tsm5, HasKey, taskName1) - c.Assert(tsm5[taskName1], DeepEquals, cfgStr3) -} diff --git a/tests/dmctl_basic/check_list/get_config.sh b/tests/dmctl_basic/check_list/get_config.sh new file mode 100644 index 0000000000..c7f76d1eb5 --- /dev/null +++ b/tests/dmctl_basic/check_list/get_config.sh @@ -0,0 +1,125 @@ +#!/bin/bash + +function get_config_wrong_arg() { + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config" \ + "get-config \[--file filename\] \[flags\]" 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config hihi haha" \ + "invalid config type 'hihi'" 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config task haha" \ + "task not found" 1 + + # test alias + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-task-config haha" \ + "task not found" 1 + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-task-config haha hihi" \ + "get-config \[--file filename\] \[flags\]" 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config master haha" \ + "master not found" 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config worker haha" \ + "worker not found" 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config source haha" \ + "source not found" 1 +} + +function diff_get_config() { + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config task test --file $WORK_DIR/get_task.yaml" \ + "\"result\": true" 1 + diff $WORK_DIR/get_task.yaml $cur/conf/get_task.yaml || exit 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config master master1 --file $dm_master_conf" \ + "\"result\": true" 1 + diff $dm_master_conf $cur/conf/get_master1.toml || exit 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config worker worker1 --file $dm_worker1_conf" \ + "\"result\": true" 1 + diff $dm_worker1_conf $cur/conf/get_worker1.toml || exit 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config worker worker2 --file $dm_worker2_conf" \ + "\"result\": true" 1 + diff $dm_worker2_conf $cur/conf/get_worker2.toml || exit 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config source mysql-replica-01 --file $WORK_DIR/get_source1.yaml" \ + "\"result\": true" 1 + diff $WORK_DIR/get_source1.yaml $cur/conf/get_source1.yaml || exit 1 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config source mysql-replica-02 --file $WORK_DIR/get_source2.yaml" \ + "\"result\": true" 1 + diff $WORK_DIR/get_source2.yaml $cur/conf/get_source2.yaml || exit 1 +} + +function get_config_to_file() { + diff_get_config + + sed -i "s/password: '\*\*\*\*\*\*'/password: ''/g" $WORK_DIR/get_task.yaml + sed -i "s/password: '\*\*\*\*\*\*'/password: '123456'/g" $WORK_DIR/get_source1.yaml + sed -i "s/password: '\*\*\*\*\*\*'/password: '123456'/g" $WORK_DIR/get_source2.yaml + + # stop task + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "stop-task test" \ + "\"result\": true" 3 + + # restart source with get config + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "operate-source stop mysql-replica-01" \ + "\"result\": true" 2 + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "operate-source create $WORK_DIR/get_source1.yaml" \ + "\"result\": true" 2 + + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "operate-source stop mysql-replica-02" \ + "\"result\": true" 2 + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "operate-source create $WORK_DIR/get_source2.yaml" \ + "\"result\": true" 2 + + # start task with get config + run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "start-task $WORK_DIR/get_task.yaml" \ + "\"result\": true" 3 + + # restart master with get config + ps aux | grep dm-master |awk '{print $2}'|xargs kill || true + check_port_offline $MASTER_PORT1 20 + run_dm_master $WORK_DIR/master $MASTER_PORT $dm_master_conf + check_rpc_alive $cur/../bin/check_master_online 127.0.0.1:$MASTER_PORT + + # restart worker with get config + ps aux | grep worker1 |awk '{print $2}'|xargs kill || true + check_port_offline $WORKER1_PORT 20 + ps aux | grep worker2 |awk '{print $2}'|xargs kill || true + check_port_offline $WORKER2_PORT 20 + run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "list-member --worker" \ + "offline" 2 + + run_dm_worker $WORK_DIR/worker1 $WORKER1_PORT $dm_worker1_conf + check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER1_PORT + run_dm_worker $WORK_DIR/worker2 $WORKER2_PORT $dm_worker2_conf + check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER2_PORT + run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "list-member --worker" \ + "bound" 2 + + diff_get_config +} diff --git a/tests/dmctl_basic/check_list/get_task_config.sh b/tests/dmctl_basic/check_list/get_task_config.sh deleted file mode 100644 index 49e7f2bffb..0000000000 --- a/tests/dmctl_basic/check_list/get_task_config.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -function get_task_config_wrong_name() { - run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "get-task-config haha" \ - "task not found" 1 -} - -function get_task_config_to_file() { - run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "get-task-config test --file $WORK_DIR/test.yaml" \ - "\"result\": true" 1 - - run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "stop-task test" \ - "\"result\": true" 3 - - run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "get-task-config test --file $WORK_DIR/test.yaml" \ - "task not found" 1 - - # start task with file - run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "start-task $WORK_DIR/test.yaml" \ - "\"result\": true" 3 -} - -function get_task_config_recover_etcd() { - run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "get-task-config test --file $WORK_DIR/test1.yaml" \ - "\"result\": true" 1 - - ps aux | grep dm-master |awk '{print $2}'|xargs kill || true - check_port_offline $MASTER_PORT1 20 - - run_dm_master $WORK_DIR/master $MASTER_PORT $dm_master_conf - check_rpc_alive $cur/../bin/check_master_online 127.0.0.1:$MASTER_PORT - - run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "get-task-config test --file $WORK_DIR/test2.yaml" \ - "\"result\": true" 1 - - diff $WORK_DIR/test1.yaml $WORK_DIR/test2.yaml || exit 1 -} diff --git a/tests/dmctl_basic/conf/dm-master.toml b/tests/dmctl_basic/conf/dm-master.toml index 14ac020290..bcef66e4b9 100644 --- a/tests/dmctl_basic/conf/dm-master.toml +++ b/tests/dmctl_basic/conf/dm-master.toml @@ -1,4 +1,5 @@ # Master Configuration. +name = "master1" master-addr = ":8261" advertise-addr = "127.0.0.1:8261" diff --git a/tests/dmctl_basic/conf/get_master1.toml b/tests/dmctl_basic/conf/get_master1.toml new file mode 100644 index 0000000000..bc1589d944 --- /dev/null +++ b/tests/dmctl_basic/conf/get_master1.toml @@ -0,0 +1,21 @@ +log-level = "debug" +log-file = "/tmp/dm_test/dmctl_basic/master/log/dm-master.log" +log-format = "text" +log-rotate = "" +rpc-timeout = "30s" +rpc-rate-limit = 10.0 +rpc-rate-burst = 40 +master-addr = ":8261" +advertise-addr = "127.0.0.1:8261" +config-file = "/tmp/dm_test/dmctl_basic/master/dm-master.toml" +name = "master1" +data-dir = "default.master1" +peer-urls = "http://127.0.0.1:8291" +advertise-peer-urls = "http://127.0.0.1:8291" +initial-cluster = "master1=http://127.0.0.1:8291" +initial-cluster-state = "new" +join = "" +v1-sources-path = "" +ssl-ca = "" +ssl-cert = "" +ssl-key = "" diff --git a/tests/dmctl_basic/conf/get_source1.yaml b/tests/dmctl_basic/conf/get_source1.yaml new file mode 100644 index 0000000000..e059f6098c --- /dev/null +++ b/tests/dmctl_basic/conf/get_source1.yaml @@ -0,0 +1,32 @@ +enable-gtid: false +auto-fix-gtid: false +relay-dir: /tmp/dm_test/dmctl_basic/worker1/relay_log +meta-dir: "" +flavor: mysql +charset: "" +enable-relay: true +relay-binlog-name: "" +relay-binlog-gtid: "" +source-id: mysql-replica-01 +from: + host: 127.0.0.1 + port: 3306 + user: root + password: '******' + max-allowed-packet: null + session: {} + security: null +purge: + interval: 3600 + expires: 0 + remain-space: 15 +checker: + check-enable: true + backoff-rollback: 5m0s + backoff-max: 5m0s + check-interval: 5s + backoff-min: 1s + backoff-jitter: true + backoff-factor: 2 +server-id: 123456 +tracer: {} diff --git a/tests/dmctl_basic/conf/get_source2.yaml b/tests/dmctl_basic/conf/get_source2.yaml new file mode 100644 index 0000000000..b58ef52df0 --- /dev/null +++ b/tests/dmctl_basic/conf/get_source2.yaml @@ -0,0 +1,32 @@ +enable-gtid: false +auto-fix-gtid: false +relay-dir: /tmp/dm_test/dmctl_basic/worker2/relay_log +meta-dir: "" +flavor: mysql +charset: "" +enable-relay: true +relay-binlog-name: "" +relay-binlog-gtid: "" +source-id: mysql-replica-02 +from: + host: 127.0.0.1 + port: 3307 + user: root + password: '******' + max-allowed-packet: null + session: {} + security: null +purge: + interval: 3600 + expires: 0 + remain-space: 15 +checker: + check-enable: true + backoff-rollback: 5m0s + backoff-max: 5m0s + check-interval: 5s + backoff-min: 1s + backoff-jitter: true + backoff-factor: 2 +server-id: 654321 +tracer: {} diff --git a/tests/dmctl_basic/conf/get_task.yaml b/tests/dmctl_basic/conf/get_task.yaml new file mode 100644 index 0000000000..7095f083d4 --- /dev/null +++ b/tests/dmctl_basic/conf/get_task.yaml @@ -0,0 +1,135 @@ +name: test +task-mode: all +is-sharding: true +shard-mode: pessimistic +ignore-checking-items: [] +meta-schema: dm_meta +enable-heartbeat: false +heartbeat-update-interval: 1 +heartbeat-report-interval: 10 +timezone: Asia/Shanghai +case-sensitive: false +target-database: + host: 127.0.0.1 + port: 4000 + user: root + password: '******' + max-allowed-packet: null + session: + tidb_txn_mode: optimistic + security: null +mysql-instances: +- source-id: mysql-replica-01 + meta: null + filter-rules: [] + column-mapping-rules: + - cm-01 + route-rules: + - route-01 + - route-02 + black-white-list: "" + block-allow-list: balist-01 + mydumper-config-name: dump-01 + mydumper: null + mydumper-thread: 0 + loader-config-name: load-01 + loader: null + loader-thread: 0 + syncer-config-name: sync-01 + syncer: null + syncer-thread: 0 +- source-id: mysql-replica-02 + meta: null + filter-rules: [] + column-mapping-rules: + - cm-02 + route-rules: + - route-01 + - route-02 + black-white-list: "" + block-allow-list: balist-01 + mydumper-config-name: dump-01 + mydumper: null + mydumper-thread: 0 + loader-config-name: load-01 + loader: null + loader-thread: 0 + syncer-config-name: sync-01 + syncer: null + syncer-thread: 0 +online-ddl-scheme: "" +routes: + route-01: + schema-pattern: dmctl + table-pattern: t_* + target-schema: dmctl + target-table: t_target + route-02: + schema-pattern: dmctl + table-pattern: "" + target-schema: dmctl + target-table: "" +filters: {} +column-mappings: + cm-01: + schema-pattern: dmctl + table-pattern: t_* + source-column: id + target-column: id + expression: partition id + arguments: + - "1" + - "" + - t_ + create-table-query: "" + cm-02: + schema-pattern: dmctl + table-pattern: t_* + source-column: id + target-column: id + expression: partition id + arguments: + - "2" + - "" + - t_ + create-table-query: "" +black-white-list: {} +block-allow-list: + balist-01: + do-tables: + - db-name: dmctl + tbl-name: ~^t_[\d]+ + do-dbs: + - dmctl + ignore-tables: [] + ignore-dbs: [] +mydumpers: + dump-01: + mydumper-path: ./bin/mydumper + threads: 4 + chunk-filesize: "64" + statement-size: 0 + rows: 0 + where: "" + skip-tz-utc: true + extra-args: "" +loaders: + load-01: + pool-size: 16 + dir: ./dumped_data.test +syncers: + sync-01: + meta-file: "" + worker-count: 16 + batch: 100 + queue-size: 1024 + checkpoint-flush-interval: 30 + max-retry: 0 + auto-fix-gtid: false + enable-gtid: false + disable-detect: false + safe-mode: false + enable-ansi-quotes: false +clean-dump-file: true +ansi-quotes: false +remove-meta: false diff --git a/tests/dmctl_basic/conf/get_worker1.toml b/tests/dmctl_basic/conf/get_worker1.toml new file mode 100644 index 0000000000..c2ef225d2d --- /dev/null +++ b/tests/dmctl_basic/conf/get_worker1.toml @@ -0,0 +1,13 @@ +name = "worker1" +log-level = "debug" +log-file = "/tmp/dm_test/dmctl_basic/worker1/log/dm-worker.log" +log-format = "text" +log-rotate = "" +join = "http://127.0.0.1:8261" +worker-addr = "0.0.0.0:8262" +advertise-addr = "127.0.0.1:8262" +config-file = "/tmp/dm_test/dmctl_basic/worker1/dm-worker.toml" +keepalive-ttl = 10 +ssl-ca = "" +ssl-cert = "" +ssl-key = "" diff --git a/tests/dmctl_basic/conf/get_worker2.toml b/tests/dmctl_basic/conf/get_worker2.toml new file mode 100644 index 0000000000..a873a41fb7 --- /dev/null +++ b/tests/dmctl_basic/conf/get_worker2.toml @@ -0,0 +1,13 @@ +name = "worker2" +log-level = "debug" +log-file = "/tmp/dm_test/dmctl_basic/worker2/log/dm-worker.log" +log-format = "text" +log-rotate = "" +join = "http://127.0.0.1:8261" +worker-addr = "0.0.0.0:8263" +advertise-addr = "127.0.0.1:8263" +config-file = "/tmp/dm_test/dmctl_basic/worker2/dm-worker.toml" +keepalive-ttl = 10 +ssl-ca = "" +ssl-cert = "" +ssl-key = "" diff --git a/tests/dmctl_basic/conf/source1.yaml b/tests/dmctl_basic/conf/source1.yaml index 80b527688d..4bbcf0f019 100644 --- a/tests/dmctl_basic/conf/source1.yaml +++ b/tests/dmctl_basic/conf/source1.yaml @@ -1,5 +1,5 @@ source-id: mysql-replica-01 -flavor: '' +server-id: 123456 enable-gtid: false relay-binlog-name: '' relay-binlog-gtid: '' diff --git a/tests/dmctl_basic/conf/source2.yaml b/tests/dmctl_basic/conf/source2.yaml index a3d54dbfc6..871d35d6eb 100644 --- a/tests/dmctl_basic/conf/source2.yaml +++ b/tests/dmctl_basic/conf/source2.yaml @@ -1,5 +1,5 @@ source-id: mysql-replica-02 -flavor: '' +server-id: 654321 enable-gtid: false relay-binlog-name: '' relay-binlog-gtid: '' diff --git a/tests/dmctl_basic/run.sh b/tests/dmctl_basic/run.sh index 9071f0f3ae..157e2ab23b 100755 --- a/tests/dmctl_basic/run.sh +++ b/tests/dmctl_basic/run.sh @@ -174,10 +174,9 @@ function run() { "\"stage\": \"Running\"" 4 # update_task_not_paused $TASK_CONF - echo "get_task_config" - get_task_config_wrong_name - get_task_config_to_file - get_task_config_recover_etcd + echo "get_config" + get_config_wrong_arg + get_config_to_file # retry to wait for recovered from etcd ready run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ diff --git a/tests/ha_master/run.sh b/tests/ha_master/run.sh index 7d1b713a5e..8112be6558 100755 --- a/tests/ha_master/run.sh +++ b/tests/ha_master/run.sh @@ -232,6 +232,14 @@ function test_list_member() { "list-member --worker" \ "\"stage\": \"bound\"" 2 + run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config master master1" \ + 'name = \\"master1\\"' 1 + + run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ + "get-config master master2" \ + 'name = \\"master2\\"' 1 + echo "[$(date)] <<<<<< finish test_list_member_command >>>>>>" } diff --git a/tests/http_apis/run.sh b/tests/http_apis/run.sh index 09087cc40b..1f4980deab 100644 --- a/tests/http_apis/run.sh +++ b/tests/http_apis/run.sh @@ -57,10 +57,6 @@ function run() { curl -X GET 127.0.0.1:$MASTER_PORT/apis/${API_VERSION}/subtasks/test > $WORK_DIR/subtask.log check_log_contains $WORK_DIR/subtask.log "is-sharding = false" 1 - echo "get task config" - curl -X GET 127.0.0.1:$MASTER_PORT/apis/${API_VERSION}/tasks/test > $WORK_DIR/task.log - check_log_contains $WORK_DIR/task.log "is-sharding: false" 1 - echo "pause task and check stage" curl -X PUT 127.0.0.1:$MASTER_PORT/apis/${API_VERSION}/tasks/test -d '{ "op": 2 }' > $WORK_DIR/pause.log check_log_contains $WORK_DIR/pause.log "\"op\": \"Pause\"" 1 diff --git a/tests/import_v10x/conf/task.yaml b/tests/import_v10x/conf/task.yaml index db0e5464c1..8d85a51204 100644 --- a/tests/import_v10x/conf/task.yaml +++ b/tests/import_v10x/conf/task.yaml @@ -43,11 +43,11 @@ mysql-instances: column-mapping-rules: [] route-rules: [] black-white-list: "" - block-allow-list: balist-02 - mydumper-config-name: dump-02 + block-allow-list: balist-01 + mydumper-config-name: dump-01 mydumper: null mydumper-thread: 0 - loader-config-name: load-02 + loader-config-name: load-01 loader: null loader-thread: 0 syncer-config-name: sync-02 @@ -65,12 +65,6 @@ block-allow-list: - import_v10x ignore-tables: [] ignore-dbs: [] - balist-02: - do-tables: [] - do-dbs: - - import_v10x - ignore-tables: [] - ignore-dbs: [] mydumpers: dump-01: mydumper-path: ./bin/mydumper @@ -81,22 +75,10 @@ mydumpers: where: "" skip-tz-utc: true extra-args: "" - dump-02: - mydumper-path: ./bin/mydumper - threads: 4 - chunk-filesize: "64" - statement-size: 0 - rows: 0 - where: "" - skip-tz-utc: true - extra-args: "" loaders: load-01: pool-size: 16 dir: ./dumped_data.test - load-02: - pool-size: 16 - dir: ./dumped_data.test syncers: sync-01: meta-file: "" diff --git a/tests/import_v10x/run.sh b/tests/import_v10x/run.sh index 3146bfafe2..918b8ed163 100644 --- a/tests/import_v10x/run.sh +++ b/tests/import_v10x/run.sh @@ -75,9 +75,10 @@ function run() { # check task config, just a simple match run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ - "get-task-config test --file $WORK_DIR/task.yaml" \ + "get-config task test --file $WORK_DIR/task.yaml" \ "\"result\": true" 1 + sed -i "s/password: '\*\*\*\*\*\*'/password: \"\"/g" $WORK_DIR/task.yaml diff $cur/conf/task.yaml $WORK_DIR/task.yaml || exit 1 run_sql "show create table \`dm_meta\`.\`test_syncer_checkpoint\`" $TIDB_PORT $TIDB_PASSWORD