Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
Signed-off-by: lance6716 <[email protected]>
  • Loading branch information
lance6716 committed Mar 23, 2022
1 parent 6e9073d commit 1a11964
Showing 1 changed file with 7 additions and 16 deletions.
23 changes: 7 additions & 16 deletions br/pkg/lightning/lightning.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,16 +259,6 @@ func (l *Lightning) RunOnceWithOptions(taskCtx context.Context, taskCfg *config.
o.checkpointName = file
})

// pre-check about options
// glue should be set when lightning in TiDB, and storages should be set when lightning in DM/dataflow engine,
// so they should not both be set.
if o.dumpFileStorage != nil && o.glue != nil {
return common.ErrInvalidArgument.GenWithStack("WithDumpFileStorage and WithGlue can't be both set")
}
if o.checkpointStorage != nil && o.glue != nil {
return common.ErrInvalidArgument.GenWithStack("WithCheckpointStorage and WithGlue can't be both set")
}

if o.dumpFileStorage != nil {
// we don't use it, set a value to pass Adjust
taskCfg.Mydumper.SourceDir = "noop://"
Expand Down Expand Up @@ -398,12 +388,13 @@ func (l *Lightning) run(taskCtx context.Context, taskCfg *config.Config, o *opti
var procedure *restore.Controller

param := &restore.ControllerParam{
DBMetas: dbMetas,
Status: &l.status,
DumpFileStorage: s,
OwnExtStorage: o.dumpFileStorage == nil,
Glue: g,
CheckpointName: o.checkpointName,
DBMetas: dbMetas,
Status: &l.status,
DumpFileStorage: s,
OwnExtStorage: o.dumpFileStorage == nil,
Glue: g,
CheckpointStorage: o.checkpointStorage,
CheckpointName: o.checkpointName,
}

procedure, err = restore.NewRestoreController(ctx, taskCfg, param)
Expand Down

0 comments on commit 1a11964

Please sign in to comment.