Skip to content

Commit

Permalink
Import all data into TiKV before updating auto id (pingcap#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
huachaohuang committed Apr 19, 2018
1 parent d151f35 commit 73be442
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lightning/restore/restore.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,11 @@ func (tr *TableRestore) makeKVDeliver() (kv.KVDeliver, error) {
}

func (tr *TableRestore) onFinished() error {
// flush all kvs into TiKV
if err := tr.importKV(); err != nil {
return errors.Trace(err)
}

// generate meta kv
var (
tableMaxRowID int64
Expand All @@ -661,11 +666,6 @@ func (tr *TableRestore) onFinished() error {
return errors.Trace(err)
}

// flush all kvs into TiKV ~
if err := tr.importKV(); err != nil {
return errors.Trace(err)
}

log.Infof("[%s] has imported %d rows", tr.tableMeta.Name, tableRows)
return nil
}
Expand Down

0 comments on commit 73be442

Please sign in to comment.