Skip to content

Commit

Permalink
config: verify subtask config when generating from task (pingcap#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
csuzhangxc authored Apr 1, 2019
1 parent 3941bee commit 514e0da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions dm/config/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,11 @@ func (c *TaskConfig) SubTaskConfigs(sources map[string]DBConfig) ([]*SubTaskConf
cfg.LoaderConfig = *inst.Loader
cfg.SyncerConfig = *inst.Syncer

err := cfg.adjust()
if err != nil {
return nil, errors.Annotatef(err, "source %s", inst.SourceID)
}

cfgs[i] = cfg
}
return cfgs, nil
Expand Down
4 changes: 2 additions & 2 deletions dm/master/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (s *Server) StartTask(ctx context.Context, req *pb.StartTaskRequest) (*pb.S
if err != nil {
return &pb.StartTaskResponse{
Result: false,
Msg: errors.Cause(err).Error(),
Msg: errors.ErrorStack(err),
}, nil
}
log.Infof("[server] starting task with config:\n%v", cfg)
Expand Down Expand Up @@ -374,7 +374,7 @@ func (s *Server) UpdateTask(ctx context.Context, req *pb.UpdateTaskRequest) (*pb
if err != nil {
return &pb.UpdateTaskResponse{
Result: false,
Msg: errors.Cause(err).Error(),
Msg: errors.ErrorStack(err),
}, nil
}
log.Infof("[server] update task with config:\n%v", cfg)
Expand Down

0 comments on commit 514e0da

Please sign in to comment.