From a878168967b1e940568e12100a93450dd54359aa Mon Sep 17 00:00:00 2001 From: ti-srebot <66930949+ti-srebot@users.noreply.github.com> Date: Wed, 27 Jan 2021 13:32:52 +0800 Subject: [PATCH] cherry pick #569 to release-4.0 (#721) Signed-off-by: ti-srebot Co-authored-by: lvtu <37565148+tongtongyin@users.noreply.github.com> Co-authored-by: 3pointer Co-authored-by: glorv --- pkg/backup/push.go | 2 +- pkg/restore/batcher.go | 2 +- pkg/restore/pipeline_items.go | 2 +- pkg/restore/split.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/backup/push.go b/pkg/backup/push.go index f0784be34..082b2c8b3 100644 --- a/pkg/backup/push.go +++ b/pkg/backup/push.go @@ -17,7 +17,7 @@ import ( "github.com/pingcap/br/pkg/rtree" ) -// pushDown warps a backup task. +// pushDown wraps a backup task. type pushDown struct { mgr ClientMgr respCh chan *backup.BackupResponse diff --git a/pkg/restore/batcher.go b/pkg/restore/batcher.go index e065d7113..18f0ff6cb 100644 --- a/pkg/restore/batcher.go +++ b/pkg/restore/batcher.go @@ -274,7 +274,7 @@ func (b *Batcher) drainRanges() DrainResult { // the batch is full, we should stop here! // we use strictly greater than because when we send a batch at equal, the offset should plus one. - // (because the last table is sent, we should put it in emptyTables), and this will intrduce extra complex. + // (because the last table is sent, we should put it in emptyTables), and this will introduce extra complex. if thisTableLen+collected > b.batchSizeThreshold { drainSize := b.batchSizeThreshold - collected thisTableRanges := thisTable.Range diff --git a/pkg/restore/pipeline_items.go b/pkg/restore/pipeline_items.go index f74d64c90..d639f4be4 100644 --- a/pkg/restore/pipeline_items.go +++ b/pkg/restore/pipeline_items.go @@ -72,7 +72,7 @@ func NewBRContextManager(client *Client) ContextManager { type brContextManager struct { client *Client - // This 'set' of table ID allow us handle each table just once. + // This 'set' of table ID allow us to handle each table just once. hasTable map[int64]CreatedTable } diff --git a/pkg/restore/split.go b/pkg/restore/split.go index 76e16b5a4..6ff850732 100644 --- a/pkg/restore/split.go +++ b/pkg/restore/split.go @@ -255,7 +255,7 @@ func (rs *RegionSplitter) splitAndScatterRegions( return nil, errors.Trace(err) } for _, region := range newRegions { - // Wait for a while until the regions successfully splits. + // Wait for a while until the regions successfully split. rs.waitForSplit(ctx, region.Region.Id) if err = rs.client.ScatterRegion(ctx, region); err != nil { log.Warn("scatter region failed", logutil.Region(region.Region), zap.Error(err))