diff --git a/dm/_utils/terror_gen/errors_release.txt b/dm/_utils/terror_gen/errors_release.txt index f6ad305846a..6e1af7f9907 100644 --- a/dm/_utils/terror_gen/errors_release.txt +++ b/dm/_utils/terror_gen/errors_release.txt @@ -152,7 +152,7 @@ ErrConfigLoaderCfgConflict,[code=20016:class=config:scope=internal:level=medium] ErrConfigSyncerCfgConflict,[code=20017:class=config:scope=internal:level=medium], "Message: syncer-config-name and syncer should only specify one, Workaround: Please check the `syncer-config-name` and `syncer` config in task configuration file." ErrConfigReadCfgFromFile,[code=20018:class=config:scope=internal:level=medium], "Message: read config file %v" ErrConfigNeedUniqueTaskName,[code=20019:class=config:scope=internal:level=medium], "Message: must specify a unique task name, Workaround: Please check the `name` config in task configuration file." -ErrConfigInvalidTaskMode,[code=20020:class=config:scope=internal:level=medium], "Message: please specify right task-mode, support `full`, `incremental`, `all`, Workaround: Please check the `task-mode` config in task configuration file." +ErrConfigInvalidTaskMode,[code=20020:class=config:scope=internal:level=medium], "Message: please specify right task-mode, support `full`, `incremental`, `all`, `dump`, `load`, Workaround: Please check the `task-mode` config in task configuration file." ErrConfigNeedTargetDB,[code=20021:class=config:scope=internal:level=medium], "Message: must specify target-database, Workaround: Please check the `target-database` config in task configuration file." ErrConfigMetadataNotSet,[code=20022:class=config:scope=internal:level=medium], "Message: mysql-instance(%s) must set meta for task-mode %s, Workaround: Please check the `meta` config in task configuration file." ErrConfigRouteRuleNotFound,[code=20023:class=config:scope=internal:level=medium], "Message: mysql-instance(%d)'s route-rules %s not exist in routes, Workaround: Please check the `route-rules` config in task configuration file." diff --git a/dm/config/helper.go b/dm/config/helper.go index 49badba0169..36fed03edeb 100644 --- a/dm/config/helper.go +++ b/dm/config/helper.go @@ -26,7 +26,7 @@ func HasDump(taskMode string) bool { // HasLoad returns true if taskMode contains load unit. func HasLoad(taskMode string) bool { switch taskMode { - case ModeAll, ModeFull, ModeLoadSync: + case ModeAll, ModeFull, ModeLoad, ModeLoadSync: return true default: return false diff --git a/dm/config/helper_test.go b/dm/config/helper_test.go index c7cc677c5c7..a644e8c1a7d 100644 --- a/dm/config/helper_test.go +++ b/dm/config/helper_test.go @@ -36,6 +36,10 @@ func TestTaskModeHasFunction(t *testing.T) { require.False(t, HasLoad(ModeDump)) require.False(t, HasSync(ModeDump)) + require.False(t, HasDump(ModeLoad)) + require.True(t, HasLoad(ModeLoad)) + require.False(t, HasSync(ModeLoad)) + require.False(t, HasDump(ModeLoadSync)) require.True(t, HasLoad(ModeLoadSync)) require.True(t, HasSync(ModeLoadSync)) diff --git a/dm/config/subtask.go b/dm/config/subtask.go index 5c28bf88b7e..514a891cab9 100644 --- a/dm/config/subtask.go +++ b/dm/config/subtask.go @@ -52,6 +52,7 @@ const ( ModeFull = "full" ModeIncrement = "incremental" ModeDump = "dump" + ModeLoad = "load" ModeLoadSync = "load&sync" DefaultShadowTableRules = "^_(.+)_(?:new|gho)$" @@ -330,6 +331,7 @@ func (c *SubTaskConfig) Adjust(verifyDecryptPassword bool) error { } // adjust dir, no need to do for load&sync mode because it needs its own s3 repository + // still use dir for standalone load mode (different from the behavior of load&sync mode) if HasLoad(c.Mode) && c.Mode != ModeLoadSync { // check isS3 := storage.IsS3Path(c.LoaderConfig.Dir) diff --git a/dm/config/task.go b/dm/config/task.go index 8cedfbd5e65..9f5a77324f0 100644 --- a/dm/config/task.go +++ b/dm/config/task.go @@ -669,7 +669,7 @@ func (c *TaskConfig) adjust() error { return terror.ErrConfigNeedUniqueTaskName.Generate() } switch c.TaskMode { - case ModeFull, ModeIncrement, ModeAll, ModeDump, ModeLoadSync: + case ModeFull, ModeIncrement, ModeAll, ModeDump, ModeLoad, ModeLoadSync: default: return terror.ErrConfigInvalidTaskMode.Generate() } @@ -774,9 +774,9 @@ func (c *TaskConfig) adjust() error { instanceIDs[inst.SourceID] = i switch c.TaskMode { - case ModeFull, ModeAll, ModeDump: + case ModeFull, ModeAll, ModeDump, ModeLoad: if inst.Meta != nil { - log.L().Warn("metadata will not be used. for Full mode, incremental sync will never occur; for All mode, the meta dumped by MyDumper will be used", zap.Int("mysql instance", i), zap.String("task mode", c.TaskMode)) + log.L().Warn("metadata will not be used. for Full/Dump/Load mode, incremental sync will never occur; for All mode, the meta dumped by MyDumper will be used", zap.Int("mysql instance", i), zap.String("task mode", c.TaskMode)) } case ModeIncrement: if inst.Meta == nil { diff --git a/dm/errors.toml b/dm/errors.toml index 7f4c65fcf2b..d78d858038e 100644 --- a/dm/errors.toml +++ b/dm/errors.toml @@ -929,7 +929,7 @@ workaround = "Please check the `name` config in task configuration file." tags = ["internal", "medium"] [error.DM-config-20020] -message = "please specify right task-mode, support `full`, `incremental`, `all`" +message = "please specify right task-mode, support `full`, `incremental`, `all`, `dump`, `load`" description = "" workaround = "Please check the `task-mode` config in task configuration file." tags = ["internal", "medium"] diff --git a/dm/openapi/gen.client.go b/dm/openapi/gen.client.go index 6ec5ed95191..30d24e9369f 100644 --- a/dm/openapi/gen.client.go +++ b/dm/openapi/gen.client.go @@ -1211,6 +1211,7 @@ func NewDMAPIGetSourceListRequest(server string, params *DMAPIGetSourceListParam queryValues := queryURL.Query() if params.WithStatus != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "with_status", runtime.ParamLocationQuery, *params.WithStatus); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -1222,9 +1223,11 @@ func NewDMAPIGetSourceListRequest(server string, params *DMAPIGetSourceListParam } } } + } if params.EnableRelay != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "enable_relay", runtime.ParamLocationQuery, *params.EnableRelay); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -1236,6 +1239,7 @@ func NewDMAPIGetSourceListRequest(server string, params *DMAPIGetSourceListParam } } } + } queryURL.RawQuery = queryValues.Encode() @@ -1317,6 +1321,7 @@ func NewDMAPIDeleteSourceRequest(server string, sourceName string, params *DMAPI queryValues := queryURL.Query() if params.Force != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -1328,6 +1333,7 @@ func NewDMAPIDeleteSourceRequest(server string, sourceName string, params *DMAPI } } } + } queryURL.RawQuery = queryValues.Encode() @@ -1369,6 +1375,7 @@ func NewDMAPIGetSourceRequest(server string, sourceName string, params *DMAPIGet queryValues := queryURL.Query() if params.WithStatus != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "with_status", runtime.ParamLocationQuery, *params.WithStatus); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -1380,6 +1387,7 @@ func NewDMAPIGetSourceRequest(server string, sourceName string, params *DMAPIGet } } } + } queryURL.RawQuery = queryValues.Encode() @@ -1826,6 +1834,7 @@ func NewDMAPIGetTaskListRequest(server string, params *DMAPIGetTaskListParams) ( queryValues := queryURL.Query() if params.WithStatus != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "with_status", runtime.ParamLocationQuery, *params.WithStatus); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -1837,9 +1846,11 @@ func NewDMAPIGetTaskListRequest(server string, params *DMAPIGetTaskListParams) ( } } } + } if params.Stage != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "stage", runtime.ParamLocationQuery, *params.Stage); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -1851,9 +1862,11 @@ func NewDMAPIGetTaskListRequest(server string, params *DMAPIGetTaskListParams) ( } } } + } if params.SourceNameList != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "source_name_list", runtime.ParamLocationQuery, *params.SourceNameList); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -1865,6 +1878,7 @@ func NewDMAPIGetTaskListRequest(server string, params *DMAPIGetTaskListParams) ( } } } + } queryURL.RawQuery = queryValues.Encode() @@ -2195,6 +2209,7 @@ func NewDMAPIDeleteTaskRequest(server string, taskName string, params *DMAPIDele queryValues := queryURL.Query() if params.Force != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "force", runtime.ParamLocationQuery, *params.Force); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -2206,6 +2221,7 @@ func NewDMAPIDeleteTaskRequest(server string, taskName string, params *DMAPIDele } } } + } queryURL.RawQuery = queryValues.Encode() @@ -2247,6 +2263,7 @@ func NewDMAPIGetTaskRequest(server string, taskName string, params *DMAPIGetTask queryValues := queryURL.Query() if params.WithStatus != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "with_status", runtime.ParamLocationQuery, *params.WithStatus); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -2258,6 +2275,7 @@ func NewDMAPIGetTaskRequest(server string, taskName string, params *DMAPIGetTask } } } + } queryURL.RawQuery = queryValues.Encode() @@ -2353,6 +2371,7 @@ func NewDMAPIGetTaskMigrateTargetsRequest(server string, taskName string, source queryValues := queryURL.Query() if params.SchemaPattern != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "schema_pattern", runtime.ParamLocationQuery, *params.SchemaPattern); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -2364,9 +2383,11 @@ func NewDMAPIGetTaskMigrateTargetsRequest(server string, taskName string, source } } } + } if params.TablePattern != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "table_pattern", runtime.ParamLocationQuery, *params.TablePattern); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -2378,6 +2399,7 @@ func NewDMAPIGetTaskMigrateTargetsRequest(server string, taskName string, source } } } + } queryURL.RawQuery = queryValues.Encode() @@ -2733,6 +2755,7 @@ func NewDMAPIGetTaskStatusRequest(server string, taskName string, params *DMAPIG queryValues := queryURL.Query() if params.SourceNameList != nil { + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "source_name_list", runtime.ParamLocationQuery, *params.SourceNameList); err != nil { return nil, err } else if parsed, err := url.ParseQuery(queryFrag); err != nil { @@ -2744,6 +2767,7 @@ func NewDMAPIGetTaskStatusRequest(server string, taskName string, params *DMAPIG } } } + } queryURL.RawQuery = queryValues.Encode() @@ -4498,6 +4522,7 @@ func ParseDMAPIGetClusterInfoResponse(rsp *http.Response) (*DMAPIGetClusterInfoR return nil, err } response.JSON200 = &dest + } return response, nil @@ -4523,6 +4548,7 @@ func ParseDMAPIUpdateClusterInfoResponse(rsp *http.Response) (*DMAPIUpdateCluste return nil, err } response.JSON200 = &dest + } return response, nil @@ -4581,6 +4607,7 @@ func ParseDMAPIOfflineMasterNodeResponse(rsp *http.Response) (*DMAPIOfflineMaste return nil, err } response.JSON400 = &dest + } return response, nil @@ -4639,6 +4666,7 @@ func ParseDMAPIOfflineWorkerNodeResponse(rsp *http.Response) (*DMAPIOfflineWorke return nil, err } response.JSON400 = &dest + } return response, nil @@ -4696,6 +4724,7 @@ func ParseDMAPIGetSourceListResponse(rsp *http.Response) (*DMAPIGetSourceListRes return nil, err } response.JSON200 = &dest + } return response, nil @@ -4754,6 +4783,7 @@ func ParseDMAPIDeleteSourceResponse(rsp *http.Response) (*DMAPIDeleteSourceRespo return nil, err } response.JSON400 = &dest + } return response, nil @@ -4779,6 +4809,7 @@ func ParseDMAPIGetSourceResponse(rsp *http.Response) (*DMAPIGetSourceResponse, e return nil, err } response.JSON200 = &dest + } return response, nil @@ -4837,6 +4868,7 @@ func ParseDMAPIDisableSourceResponse(rsp *http.Response) (*DMAPIDisableSourceRes return nil, err } response.JSON400 = &dest + } return response, nil @@ -4862,6 +4894,7 @@ func ParseDMAPIEnableSourceResponse(rsp *http.Response) (*DMAPIEnableSourceRespo return nil, err } response.JSON400 = &dest + } return response, nil @@ -4887,6 +4920,7 @@ func ParseDMAPIDisableRelayResponse(rsp *http.Response) (*DMAPIDisableRelayRespo return nil, err } response.JSON400 = &dest + } return response, nil @@ -4912,6 +4946,7 @@ func ParseDMAPIEnableRelayResponse(rsp *http.Response) (*DMAPIEnableRelayRespons return nil, err } response.JSON400 = &dest + } return response, nil @@ -4937,6 +4972,7 @@ func ParseDMAPIPurgeRelayResponse(rsp *http.Response) (*DMAPIPurgeRelayResponse, return nil, err } response.JSON400 = &dest + } return response, nil @@ -5061,6 +5097,7 @@ func ParseDMAPITransferSourceResponse(rsp *http.Response) (*DMAPITransferSourceR return nil, err } response.JSON400 = &dest + } return response, nil @@ -5284,6 +5321,7 @@ func ParseDMAPIDeleteTaskTemplateResponse(rsp *http.Response) (*DMAPIDeleteTaskT return nil, err } response.JSON400 = &dest + } return response, nil @@ -5375,6 +5413,7 @@ func ParseDMAPIDeleteTaskResponse(rsp *http.Response) (*DMAPIDeleteTaskResponse, return nil, err } response.JSON400 = &dest + } return response, nil @@ -5400,6 +5439,7 @@ func ParseDMAPIGetTaskResponse(rsp *http.Response) (*DMAPIGetTaskResponse, error return nil, err } response.JSON200 = &dest + } return response, nil @@ -5557,6 +5597,7 @@ func ParseDMAPIDeleteTableStructureResponse(rsp *http.Response) (*DMAPIDeleteTab return nil, err } response.JSON400 = &dest + } return response, nil @@ -5615,6 +5656,7 @@ func ParseDMAPIOperateTableStructureResponse(rsp *http.Response) (*DMAPIOperateT return nil, err } response.JSON400 = &dest + } return response, nil @@ -5640,6 +5682,7 @@ func ParseDMAPIStartTaskResponse(rsp *http.Response) (*DMAPIStartTaskResponse, e return nil, err } response.JSON400 = &dest + } return response, nil @@ -5698,6 +5741,7 @@ func ParseDMAPIStopTaskResponse(rsp *http.Response) (*DMAPIStopTaskResponse, err return nil, err } response.JSON400 = &dest + } return response, nil diff --git a/dm/openapi/gen.server.go b/dm/openapi/gen.server.go index 12964ec809d..5ce0f988996 100644 --- a/dm/openapi/gen.server.go +++ b/dm/openapi/gen.server.go @@ -161,6 +161,7 @@ type MiddlewareFunc func(c *gin.Context) // DMAPIGetClusterInfo operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetClusterInfo(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -170,6 +171,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetClusterInfo(c *gin.Context) { // DMAPIUpdateClusterInfo operation middleware func (siw *ServerInterfaceWrapper) DMAPIUpdateClusterInfo(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -179,6 +181,7 @@ func (siw *ServerInterfaceWrapper) DMAPIUpdateClusterInfo(c *gin.Context) { // DMAPIGetClusterMasterList operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetClusterMasterList(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -188,6 +191,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetClusterMasterList(c *gin.Context) { // DMAPIOfflineMasterNode operation middleware func (siw *ServerInterfaceWrapper) DMAPIOfflineMasterNode(c *gin.Context) { + var err error // ------------- Path parameter "master-name" ------------- @@ -208,6 +212,7 @@ func (siw *ServerInterfaceWrapper) DMAPIOfflineMasterNode(c *gin.Context) { // DMAPIGetClusterWorkerList operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetClusterWorkerList(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -217,6 +222,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetClusterWorkerList(c *gin.Context) { // DMAPIOfflineWorkerNode operation middleware func (siw *ServerInterfaceWrapper) DMAPIOfflineWorkerNode(c *gin.Context) { + var err error // ------------- Path parameter "worker-name" ------------- @@ -237,6 +243,7 @@ func (siw *ServerInterfaceWrapper) DMAPIOfflineWorkerNode(c *gin.Context) { // GetDocJSON operation middleware func (siw *ServerInterfaceWrapper) GetDocJSON(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -246,6 +253,7 @@ func (siw *ServerInterfaceWrapper) GetDocJSON(c *gin.Context) { // GetDocHTML operation middleware func (siw *ServerInterfaceWrapper) GetDocHTML(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -255,6 +263,7 @@ func (siw *ServerInterfaceWrapper) GetDocHTML(c *gin.Context) { // DMAPIGetSourceList operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetSourceList(c *gin.Context) { + var err error // Parameter object where we will unmarshal all parameters from the context @@ -262,6 +271,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSourceList(c *gin.Context) { // ------------- Optional query parameter "with_status" ------------- if paramValue := c.Query("with_status"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "with_status", c.Request.URL.Query(), ¶ms.WithStatus) @@ -272,6 +282,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSourceList(c *gin.Context) { // ------------- Optional query parameter "enable_relay" ------------- if paramValue := c.Query("enable_relay"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "enable_relay", c.Request.URL.Query(), ¶ms.EnableRelay) @@ -289,6 +300,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSourceList(c *gin.Context) { // DMAPICreateSource operation middleware func (siw *ServerInterfaceWrapper) DMAPICreateSource(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -298,6 +310,7 @@ func (siw *ServerInterfaceWrapper) DMAPICreateSource(c *gin.Context) { // DMAPIDeleteSource operation middleware func (siw *ServerInterfaceWrapper) DMAPIDeleteSource(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -314,6 +327,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDeleteSource(c *gin.Context) { // ------------- Optional query parameter "force" ------------- if paramValue := c.Query("force"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "force", c.Request.URL.Query(), ¶ms.Force) @@ -331,6 +345,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDeleteSource(c *gin.Context) { // DMAPIGetSource operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetSource(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -347,6 +362,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSource(c *gin.Context) { // ------------- Optional query parameter "with_status" ------------- if paramValue := c.Query("with_status"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "with_status", c.Request.URL.Query(), ¶ms.WithStatus) @@ -364,6 +380,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSource(c *gin.Context) { // DMAPIUpdateSource operation middleware func (siw *ServerInterfaceWrapper) DMAPIUpdateSource(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -384,6 +401,7 @@ func (siw *ServerInterfaceWrapper) DMAPIUpdateSource(c *gin.Context) { // DMAPIDisableSource operation middleware func (siw *ServerInterfaceWrapper) DMAPIDisableSource(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -404,6 +422,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDisableSource(c *gin.Context) { // DMAPIEnableSource operation middleware func (siw *ServerInterfaceWrapper) DMAPIEnableSource(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -424,6 +443,7 @@ func (siw *ServerInterfaceWrapper) DMAPIEnableSource(c *gin.Context) { // DMAPIDisableRelay operation middleware func (siw *ServerInterfaceWrapper) DMAPIDisableRelay(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -444,6 +464,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDisableRelay(c *gin.Context) { // DMAPIEnableRelay operation middleware func (siw *ServerInterfaceWrapper) DMAPIEnableRelay(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -464,6 +485,7 @@ func (siw *ServerInterfaceWrapper) DMAPIEnableRelay(c *gin.Context) { // DMAPIPurgeRelay operation middleware func (siw *ServerInterfaceWrapper) DMAPIPurgeRelay(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -484,6 +506,7 @@ func (siw *ServerInterfaceWrapper) DMAPIPurgeRelay(c *gin.Context) { // DMAPIGetSourceSchemaList operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetSourceSchemaList(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -504,6 +527,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSourceSchemaList(c *gin.Context) { // DMAPIGetSourceTableList operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetSourceTableList(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -533,6 +557,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSourceTableList(c *gin.Context) { // DMAPIGetSourceStatus operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetSourceStatus(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -553,6 +578,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSourceStatus(c *gin.Context) { // DMAPITransferSource operation middleware func (siw *ServerInterfaceWrapper) DMAPITransferSource(c *gin.Context) { + var err error // ------------- Path parameter "source-name" ------------- @@ -573,6 +599,7 @@ func (siw *ServerInterfaceWrapper) DMAPITransferSource(c *gin.Context) { // DMAPIGetTaskList operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTaskList(c *gin.Context) { + var err error // Parameter object where we will unmarshal all parameters from the context @@ -580,6 +607,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskList(c *gin.Context) { // ------------- Optional query parameter "with_status" ------------- if paramValue := c.Query("with_status"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "with_status", c.Request.URL.Query(), ¶ms.WithStatus) @@ -590,6 +618,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskList(c *gin.Context) { // ------------- Optional query parameter "stage" ------------- if paramValue := c.Query("stage"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "stage", c.Request.URL.Query(), ¶ms.Stage) @@ -600,6 +629,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskList(c *gin.Context) { // ------------- Optional query parameter "source_name_list" ------------- if paramValue := c.Query("source_name_list"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "source_name_list", c.Request.URL.Query(), ¶ms.SourceNameList) @@ -617,6 +647,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskList(c *gin.Context) { // DMAPICreateTask operation middleware func (siw *ServerInterfaceWrapper) DMAPICreateTask(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -626,6 +657,7 @@ func (siw *ServerInterfaceWrapper) DMAPICreateTask(c *gin.Context) { // DMAPIConvertTask operation middleware func (siw *ServerInterfaceWrapper) DMAPIConvertTask(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -635,6 +667,7 @@ func (siw *ServerInterfaceWrapper) DMAPIConvertTask(c *gin.Context) { // DMAPIGetTaskTemplateList operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTaskTemplateList(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -644,6 +677,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskTemplateList(c *gin.Context) { // DMAPICreateTaskTemplate operation middleware func (siw *ServerInterfaceWrapper) DMAPICreateTaskTemplate(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -653,6 +687,7 @@ func (siw *ServerInterfaceWrapper) DMAPICreateTaskTemplate(c *gin.Context) { // DMAPIImportTaskTemplate operation middleware func (siw *ServerInterfaceWrapper) DMAPIImportTaskTemplate(c *gin.Context) { + for _, middleware := range siw.HandlerMiddlewares { middleware(c) } @@ -662,6 +697,7 @@ func (siw *ServerInterfaceWrapper) DMAPIImportTaskTemplate(c *gin.Context) { // DMAPIDeleteTaskTemplate operation middleware func (siw *ServerInterfaceWrapper) DMAPIDeleteTaskTemplate(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -682,6 +718,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDeleteTaskTemplate(c *gin.Context) { // DMAPIGetTaskTemplate operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTaskTemplate(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -702,6 +739,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskTemplate(c *gin.Context) { // DMAPUpdateTaskTemplate operation middleware func (siw *ServerInterfaceWrapper) DMAPUpdateTaskTemplate(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -722,6 +760,7 @@ func (siw *ServerInterfaceWrapper) DMAPUpdateTaskTemplate(c *gin.Context) { // DMAPIDeleteTask operation middleware func (siw *ServerInterfaceWrapper) DMAPIDeleteTask(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -738,6 +777,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDeleteTask(c *gin.Context) { // ------------- Optional query parameter "force" ------------- if paramValue := c.Query("force"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "force", c.Request.URL.Query(), ¶ms.Force) @@ -755,6 +795,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDeleteTask(c *gin.Context) { // DMAPIGetTask operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTask(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -771,6 +812,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTask(c *gin.Context) { // ------------- Optional query parameter "with_status" ------------- if paramValue := c.Query("with_status"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "with_status", c.Request.URL.Query(), ¶ms.WithStatus) @@ -788,6 +830,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTask(c *gin.Context) { // DMAPIUpdateTask operation middleware func (siw *ServerInterfaceWrapper) DMAPIUpdateTask(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -808,6 +851,7 @@ func (siw *ServerInterfaceWrapper) DMAPIUpdateTask(c *gin.Context) { // DMAPIGetTaskMigrateTargets operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTaskMigrateTargets(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -833,6 +877,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskMigrateTargets(c *gin.Context) { // ------------- Optional query parameter "schema_pattern" ------------- if paramValue := c.Query("schema_pattern"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "schema_pattern", c.Request.URL.Query(), ¶ms.SchemaPattern) @@ -843,6 +888,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskMigrateTargets(c *gin.Context) { // ------------- Optional query parameter "table_pattern" ------------- if paramValue := c.Query("table_pattern"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "table_pattern", c.Request.URL.Query(), ¶ms.TablePattern) @@ -860,6 +906,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskMigrateTargets(c *gin.Context) { // DMAPIGetSchemaListByTaskAndSource operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetSchemaListByTaskAndSource(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -889,6 +936,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetSchemaListByTaskAndSource(c *gin.Cont // DMAPIGetTableListByTaskAndSource operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTableListByTaskAndSource(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -927,6 +975,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTableListByTaskAndSource(c *gin.Conte // DMAPIDeleteTableStructure operation middleware func (siw *ServerInterfaceWrapper) DMAPIDeleteTableStructure(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -974,6 +1023,7 @@ func (siw *ServerInterfaceWrapper) DMAPIDeleteTableStructure(c *gin.Context) { // DMAPIGetTableStructure operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTableStructure(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -1021,6 +1071,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTableStructure(c *gin.Context) { // DMAPIOperateTableStructure operation middleware func (siw *ServerInterfaceWrapper) DMAPIOperateTableStructure(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -1068,6 +1119,7 @@ func (siw *ServerInterfaceWrapper) DMAPIOperateTableStructure(c *gin.Context) { // DMAPIStartTask operation middleware func (siw *ServerInterfaceWrapper) DMAPIStartTask(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -1088,6 +1140,7 @@ func (siw *ServerInterfaceWrapper) DMAPIStartTask(c *gin.Context) { // DMAPIGetTaskStatus operation middleware func (siw *ServerInterfaceWrapper) DMAPIGetTaskStatus(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -1104,6 +1157,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskStatus(c *gin.Context) { // ------------- Optional query parameter "source_name_list" ------------- if paramValue := c.Query("source_name_list"); paramValue != "" { + } err = runtime.BindQueryParameter("form", true, false, "source_name_list", c.Request.URL.Query(), ¶ms.SourceNameList) @@ -1121,6 +1175,7 @@ func (siw *ServerInterfaceWrapper) DMAPIGetTaskStatus(c *gin.Context) { // DMAPIStopTask operation middleware func (siw *ServerInterfaceWrapper) DMAPIStopTask(c *gin.Context) { + var err error // ------------- Path parameter "task-name" ------------- @@ -1248,6 +1303,7 @@ func RegisterHandlersWithOptions(router *gin.Engine, si ServerInterface, options // Base64 encoded, gzipped, json marshaled Swagger object var swaggerSpec = []string{ + "H4sIAAAAAAAC/+x9bXPbOJLwX8Gj5z7sTEmWZDtO4qv9kMSerO+cl4o9tbe1lWMgEpSwJgEGAO3Rpvzf", "r/BCEiQBkrItx5pkP+w4Igh0N/odjea3UUjTjBJEBB8dfxvxcIVSqP58lSAm3kECl4hd0owmdLmWv2eM", "ZogJjNSoFeVC/hf9AdMsQaPj0Xz/+d5sb7Y3H41HYp3Jn7hgmCxHt+NRRll9+MvZy4NyHCYCLREb3d6O", @@ -1306,56 +1362,56 @@ var swaggerSpec = []string{ "0Ru5eStIIp1bjRMcChQpTFRkmqf6wDRLdCq6uMigiW/Jl6VmpZJR7r37uOMGrtVBC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GTq8Y9UKxGhSEYWTCM", - "bDWuSyZc+U1/h//PLcY5dPjhT2xHqaZro5H8oI0sHIaBElY1n3wcCXM0u9wxCbMa4G8kYWZjpt+MF7aR", - "hBnvcYCE2eD5JcyC4ceWsPrnDDo3Mkr3CuCckvUWiRMa/tfFh/ceUaqDJecqb1y32S2iIVDLVVBFNGxA", - "ZHzUDnD+dvnufBA4cmAPOCuhS4N84Oggr1/1VC1j+5hZyldx81b1cCgvsyme/pojtraYGotVUI5wMLG7", - "5O527PiszRowJHKmm2rpyr6J6adTXApzgVBrI7MJDJ+3q30dXXodkmK3OkiKXtoNPmgOqfihiPFVjMZ9", - "+29/dmFbzrbjyw6bO9zzB4OnzIk8eTunW5ICSKKimhUCgm7sXXdteFsHTL9ZJwv9Vu5EPSyZolMnLBO6", - "UI3NcoK/5vX+HH6DVz/oGGTwvPej2wojpvqmLc0KSGDCTROxokOMSuiYcgqX6lBz3FNn7IDh1XwAYB9P", - "jYfYkF3klcexadu0Jx36rOzdfujkRUN5KkCsPhfVti9dDNGXxtkZnvi8HbvnSuPf1hOhEtzb78MaT0wP", - "mSwWvK9tm0b6A0kqCe53e8xnlHaLRftihidnWzSRH2BTqxZBHXuqv1b0c0u3uaWlG3rfHVUh2WbC+qno", - "FPpjmhPXl99ujT3ZVc1QtWqMc6Kb/RbXXx+GwTZQHD84ezm+9bar3GWU1NaZq2xC1sFbVZfrH5e12p2+", - "h7vBT5vTFAfUGhRvzkvWd9AHhNi6neuQZO0WWMffDG27AW69he2OHFAV/d508aovOTuUPabf9B9VBm8A", - "s6ia76fHK+OOAl/P8hXuA5d31v9ulUvrvVF2i0l1/fPdebTs7zREg5UNEJ+ONey8OPMoZ0GND9jtCPvY", - "X9mvmnk9hIclGCQ8Np/+97tXl2bYj55rbJez/llcrIIRSlVFAdRfptG1Aj3cpY94+jRT8f3OXgaSPA/5", - "1WOefpt7U4t10UZSN9xzrVk8G2qwygaHXas65KO5bLOx5nij9LRlM7esalufaXUwoSJyYhp+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", + "H01pEXVvAOcVd8eGmdTidtgj1LPuuGovL+fdS8dfVjf7tiHr5k7X91PvPgCeqD6v7ewmwjU1zWa6lfuZ", + "GvRI+968o7o5G+xvCZ7d0c+mm9Xd2eKb6lm6SQ1fgzs2io7ttqmOsLiEZWBQ7Ou3utN1c/6b1U0FPthY", + "7s42zX44xd62111b7i2Qq+5Y/9z0nSlNG7rvLf19N639VDmiq9hawYCuEQE4Vp8NATxfFGEfK3sV/Sy3", + "9kX6A8zEzvDFI+RKv4d2agSRh77OeB1F1f7d7yupfsoMsNUq6vslGGc/eoKxrK4emGC0TJbnfK7owVf0", + "1xySDqr17eQ7o8gevTjCecai++ObvuwjX9HDr8Nn1C30uydUY359/DPxNrfs3Mm4OquzqysgiUw3WvMD", + "o7kwd9Fw7WLx3aVycC1ZWUX2ei1p/YpEdztB/0GE8md1Wxd/u0vc7s3FG5a8lcVuP1n6ZxHezsqSsxLv", + "gUVJvrdI0IYpiUWCLgTLQ5GznzL11GRq7O9o6yN5wQGDae7+eN/up+9rksctFt80OfNTQn5KyPz7BEt1", + "5tv9YKlTDP1ZsjI981MUN178RxHEh09RWknBphz+uWqxtcRtaDa7vVYBe+tcLuSYHzDzXeK96/dx1Sbf", + "Mfk87GaR9WXZHVT2ZUvzXa+t39FLTOZaheaezbiTZr3Ki2Y/pO7SaO++6qKZX3Opj4+w62JH683n1zTf", + "i2gKMVGt50eS1GYCty4Y9XW7j2g4uMW96Wk//Zrj8GqiNPBEl6VOqq5gNR0zcnlmCu3tQnWDxWoSpRY8", + "atk2NEUX2HJc8cPt59v/CwAA//+sem7oZLwAAA==", } // GetSwagger returns the content of the embedded swagger specification file @@ -1390,7 +1446,7 @@ func decodeSpecCached() func() ([]byte, error) { // Constructs a synthetic filesystem for resolving external references when loading openapi specifications. func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { - res := make(map[string]func() ([]byte, error)) + var res = make(map[string]func() ([]byte, error)) if len(pathToFile) > 0 { res[pathToFile] = rawSpec } @@ -1404,12 +1460,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { // Externally referenced files must be embedded in the corresponding golang packages. // Urls can be supported but this task was out of the scope. func GetSwagger() (swagger *openapi3.T, err error) { - resolvePath := PathToRawSpec("") + var resolvePath = PathToRawSpec("") loader := openapi3.NewLoader() loader.IsExternalRefsAllowed = true loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { - pathToFile := url.String() + var pathToFile = url.String() pathToFile = path.Clean(pathToFile) getSpec, ok := resolvePath[pathToFile] if !ok { diff --git a/dm/openapi/gen.types.go b/dm/openapi/gen.types.go index a1ac719d35d..646d16dc409 100644 --- a/dm/openapi/gen.types.go +++ b/dm/openapi/gen.types.go @@ -31,6 +31,8 @@ const ( TaskTaskModeFull TaskTaskMode = "full" TaskTaskModeIncremental TaskTaskMode = "incremental" + + TaskTaskModeLoad TaskTaskMode = "load" ) // Defines values for TaskFullMigrateConfAnalyze. diff --git a/dm/openapi/spec/dm.yaml b/dm/openapi/spec/dm.yaml index 9881b1538a2..7fef828200e 100644 --- a/dm/openapi/spec/dm.yaml +++ b/dm/openapi/spec/dm.yaml @@ -1825,6 +1825,7 @@ components: - "full" - "incremental" - "all" + - "load" shard_mode: type: string description: the way to coordinate DDL diff --git a/dm/pkg/terror/error_list.go b/dm/pkg/terror/error_list.go index dfa040e989f..602a4b58313 100644 --- a/dm/pkg/terror/error_list.go +++ b/dm/pkg/terror/error_list.go @@ -935,7 +935,7 @@ var ( ErrConfigSyncerCfgConflict = New(codeConfigSyncerCfgConflict, ClassConfig, ScopeInternal, LevelMedium, "syncer-config-name and syncer should only specify one", "Please check the `syncer-config-name` and `syncer` config in task configuration file.") ErrConfigReadCfgFromFile = New(codeConfigReadCfgFromFile, ClassConfig, ScopeInternal, LevelMedium, "read config file %v", "") ErrConfigNeedUniqueTaskName = New(codeConfigNeedUniqueTaskName, ClassConfig, ScopeInternal, LevelMedium, "must specify a unique task name", "Please check the `name` config in task configuration file.") - ErrConfigInvalidTaskMode = New(codeConfigInvalidTaskMode, ClassConfig, ScopeInternal, LevelMedium, "please specify right task-mode, support `full`, `incremental`, `all`", "Please check the `task-mode` config in task configuration file.") + ErrConfigInvalidTaskMode = New(codeConfigInvalidTaskMode, ClassConfig, ScopeInternal, LevelMedium, "please specify right task-mode, support `full`, `incremental`, `all`, `dump`, `load`", "Please check the `task-mode` config in task configuration file.") ErrConfigNeedTargetDB = New(codeConfigNeedTargetDB, ClassConfig, ScopeInternal, LevelMedium, "must specify target-database", "Please check the `target-database` config in task configuration file.") ErrConfigMetadataNotSet = New(codeConfigMetadataNotSet, ClassConfig, ScopeInternal, LevelMedium, "mysql-instance(%s) must set meta for task-mode %s", "Please check the `meta` config in task configuration file.") ErrConfigRouteRuleNotFound = New(codeConfigRouteRuleNotFound, ClassConfig, ScopeInternal, LevelMedium, "mysql-instance(%d)'s route-rules %s not exist in routes", "Please check the `route-rules` config in task configuration file.") diff --git a/dm/worker/subtask.go b/dm/worker/subtask.go index 8db5b050a63..e5c2e5980a0 100644 --- a/dm/worker/subtask.go +++ b/dm/worker/subtask.go @@ -69,6 +69,8 @@ func createRealUnits(cfg *config.SubTaskConfig, etcdClient *clientv3.Client, wor us = append(us, syncer.NewSyncer(cfg, etcdClient, relay)) case config.ModeDump: us = append(us, dumpling.NewDumpling(cfg)) + case config.ModeLoad: + us = append(us, loader.NewLightning(cfg, etcdClient, workerName)) case config.ModeLoadSync: us = append(us, loader.NewLightning(cfg, etcdClient, workerName)) us = append(us, syncer.NewSyncer(cfg, etcdClient, relay)) diff --git a/engine/executor/dm/worker.go b/engine/executor/dm/worker.go index 21445c8f3b8..502b280e6db 100644 --- a/engine/executor/dm/worker.go +++ b/engine/executor/dm/worker.go @@ -152,12 +152,12 @@ func (w *dmWorker) InitImpl(ctx context.Context) error { if err := w.messageAgent.UpdateClient(w.masterID, w); err != nil { return err } - // for dump/load&sync mode task, we needn't to setup external storage - // these two tasks will directly read/write data from/to user specified external storage without executor's management - // for all/full mode task, the dump/load units run on a same executor, so they can access the s3 data under a same executor - // but for dump/load&sync mode task, import API needs a clear S3 URI without exector's prefix, - // what's more, dump/load units may not be executed on a same executor, - // so we choose to use user's own external storage and don't set up here. + // For dump/load/load&sync mode tasks, we don’t need to set up external storage. + // These tasks directly read/write data to/from user-specified external storage without the executor's management. + // In all/full mode tasks, dump/load units run on the same executor, allowing access to S3 data under the same executor's namespace. + // However, for dump/load & sync mode tasks, the import API requires a plain S3 URI without the executor's prefix. + // Additionally, dump/load units may not run on the same executor, + // so we opt to use the user’s external storage directly instead of configuring it here. if (w.cfg.Mode == dmconfig.ModeAll || w.cfg.Mode == dmconfig.ModeFull) && w.needExtStorage { if err := w.setupStorage(ctx); err != nil { return err @@ -258,8 +258,10 @@ func (w *dmWorker) updateStatusWhenStageChange(ctx context.Context) error { return w.UpdateStatus(ctx, status) } - // now we are in StageFinished - // for all and full mode, resource is managed by engine, we need to discard them + // Now we are in StageFinished + // For all and full mode, resource is managed by engine, we need to discard them + // In standalone modes (e.g., dump and load), we use user-specified storage. + // No additional operations on storage are needed, leaving management to the user. if w.cfg.Mode == dmconfig.ModeAll || w.cfg.Mode == dmconfig.ModeFull { switch w.workerType { case frameModel.WorkerDMDump: diff --git a/engine/jobmaster/dm/task_manager.go b/engine/jobmaster/dm/task_manager.go index 5009e21d439..e2f1973e3e5 100644 --- a/engine/jobmaster/dm/task_manager.go +++ b/engine/jobmaster/dm/task_manager.go @@ -287,7 +287,8 @@ func (tm *TaskManager) allFinished(ctx context.Context) bool { if runningTask.Unit != frameModel.WorkerDMLoad { return false } - case dmconfig.ModeDump: + case dmconfig.ModeDump, dmconfig.ModeLoad, dmconfig.ModeLoadSync: + // passing through, as long as the stage is done default: return false } diff --git a/engine/jobmaster/dm/worker_manager.go b/engine/jobmaster/dm/worker_manager.go index a628e77a009..e845ed11f2d 100644 --- a/engine/jobmaster/dm/worker_manager.go +++ b/engine/jobmaster/dm/worker_manager.go @@ -302,6 +302,9 @@ var workerSeqMap = map[string][]frameModel.WorkerType{ dmconfig.ModeDump: { frameModel.WorkerDMDump, }, + dmconfig.ModeLoad: { + frameModel.WorkerDMLoad, + }, dmconfig.ModeLoadSync: { frameModel.WorkerDMLoad, frameModel.WorkerDMSync,