From 8043a9c6234e8aba2d005cfb6768f539f78787ff Mon Sep 17 00:00:00 2001 From: 5kbpers Date: Tue, 17 Mar 2020 14:32:41 +0800 Subject: [PATCH] address comments Signed-off-by: 5kbpers --- pkg/conn/conn.go | 4 ++-- pkg/restore/client.go | 4 ++-- pkg/task/restore.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/conn/conn.go b/pkg/conn/conn.go index cdfc78168..63203b70e 100644 --- a/pkg/conn/conn.go +++ b/pkg/conn/conn.go @@ -127,9 +127,9 @@ skipStore: if unexpectedStoreBehavior == SkipTiFlash { continue skipStore } - return nil, errors.Errorf( - "cannot restore to a cluster with active TiFlash stores (store %d at %s)", store.Id, store.Address) } + return nil, errors.Errorf( + "cannot restore to a cluster with active TiFlash stores (store %d at %s)", store.Id, store.Address) } stores[j] = store j++ diff --git a/pkg/restore/client.go b/pkg/restore/client.go index ec2512b19..d40f27b4e 100644 --- a/pkg/restore/client.go +++ b/pkg/restore/client.go @@ -346,7 +346,7 @@ func (rc *Client) ExecDDLs(ddlJobs []*model.Job) error { func (rc *Client) setSpeedLimit() error { if !rc.hasSpeedLimited && rc.rateLimit != 0 { - stores, err := conn.GetAllTiKVStores(rc.ctx, rc.pdClient, conn.ErrorOnTiFlash) + stores, err := conn.GetAllTiKVStores(rc.ctx, rc.pdClient, conn.SkipTiFlash) if err != nil { return err } @@ -486,7 +486,7 @@ func (rc *Client) SwitchToNormalMode(ctx context.Context) error { } func (rc *Client) switchTiKVMode(ctx context.Context, mode import_sstpb.SwitchMode) error { - stores, err := conn.GetAllTiKVStores(ctx, rc.pdClient, conn.ErrorOnTiFlash) + stores, err := conn.GetAllTiKVStores(ctx, rc.pdClient, conn.SkipTiFlash) if err != nil { return errors.Trace(err) } diff --git a/pkg/task/restore.go b/pkg/task/restore.go index f2143764c..451aa67b0 100644 --- a/pkg/task/restore.go +++ b/pkg/task/restore.go @@ -75,7 +75,7 @@ func RunRestore(c context.Context, g glue.Glue, cmdName string, cfg *RestoreConf ctx, cancel := context.WithCancel(c) defer cancel() - mgr, err := newMgr(ctx, g, cfg.PD, cfg.TLS, conn.ErrorOnTiFlash) + mgr, err := newMgr(ctx, g, cfg.PD, cfg.TLS, conn.SkipTiFlash) if err != nil { return err }