From c04af0cf20dc1a728ed0db9275122346c8a36635 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Tue, 5 Jan 2021 07:35:59 +0800 Subject: [PATCH] restore: don't change TiDB config to support lightning via SQL (#545) --- lightning/restore/checksum.go | 1 + lightning/restore/restore.go | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lightning/restore/checksum.go b/lightning/restore/checksum.go index 5d95fc386..2eec53938 100644 --- a/lightning/restore/checksum.go +++ b/lightning/restore/checksum.go @@ -75,6 +75,7 @@ func newChecksumManager(ctx context.Context, rc *RestoreController) (ChecksumMan return nil, errors.Trace(err) } + // TODO: make tikv.Driver{}.Open use arguments instead of global variables if tlsOpt.CAPath != "" { conf := tidbcfg.GetGlobalConfig() conf.Security.ClusterSSLCA = tlsOpt.CAPath diff --git a/lightning/restore/restore.go b/lightning/restore/restore.go index 2af53ea81..3e7594979 100644 --- a/lightning/restore/restore.go +++ b/lightning/restore/restore.go @@ -31,7 +31,6 @@ import ( sstpb "github.com/pingcap/kvproto/pkg/import_sstpb" "github.com/pingcap/parser/model" "github.com/pingcap/tidb-lightning/lightning/glue" - tidbcfg "github.com/pingcap/tidb/config" "github.com/pingcap/tidb/meta/autoid" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/table/tables" @@ -73,8 +72,6 @@ const ( var DeliverPauser = common.NewPauser() func init() { - cfg := tidbcfg.GetGlobalConfig() - cfg.Log.SlowThreshold = 3000 // used in integration tests failpoint.Inject("SetMinDeliverBytes", func(v failpoint.Value) { minDeliverBytes = uint64(v.(int))