Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
Signed-off-by: 5kbpers <tangminghua@pingcap.com>
  • Loading branch information
5kbpers committed Feb 11, 2020
1 parent 985676b commit 6280302
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions pkg/restore/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,8 @@ func (importer *FileImporter) Import(file *backup.File, rewriteRules *RewriteRul
err1 = importer.ingestSST(downloadMeta, info)
// If error is `NotLeader`, update the region info and retry
for err1 == errNotLeader {
log.Debug("ingest sst returns not leader error, retry it",
zap.Stringer("region", info.Region))
var newInfo *RegionInfo
newInfo, err1 = importer.metaClient.GetRegion(ctx, info.Region.GetStartKey())
if err1 != nil {
Expand Down
3 changes: 1 addition & 2 deletions pkg/utils/retry.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@ func WithRetry(
select {
case <-ctx.Done():
return lastErr
default:
time.Sleep(backoffer.NextBackoff(err))
case <-time.After(backoffer.NextBackoff(err)):
}
} else {
return nil
Expand Down

0 comments on commit 6280302

Please sign in to comment.