From 73be4421787826a6bbd6b7da7934793e3a9acdfb Mon Sep 17 00:00:00 2001 From: Huachao Huang Date: Thu, 19 Apr 2018 14:28:19 +0800 Subject: [PATCH] Import all data into TiKV before updating auto id (#35) --- lightning/restore/restore.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lightning/restore/restore.go b/lightning/restore/restore.go index c8610c047cbf7..db10070480450 100644 --- a/lightning/restore/restore.go +++ b/lightning/restore/restore.go @@ -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 @@ -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 }