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

Commit

Permalink
use more elegent function
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 committed Aug 30, 2021
1 parent 6848e1d commit 7ed0072
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkg/schema/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,11 @@ type Tracker struct {
func NewTracker(ctx context.Context, task string, sessionCfg map[string]string, tidbConn *conn.BaseConn) (*Tracker, error) {
// NOTE: tidb uses a **global** config so can't isolate tracker's config from each other. If that isolation is needed,
// we might SetGlobalConfig before every call to tracker, or use some patch like https://github.com/bouk/monkey
toSet := tidbConfig.NewConfig()
// bypass wait time of https://github.com/pingcap/tidb/pull/20550
toSet.TiKVClient.AsyncCommit.SafeWindow = 0
toSet.TiKVClient.AsyncCommit.AllowedClockDrift = 0
// set a negative lease will disable the background statistic jobs.
toSet.Performance.StatsLease = "-1s"
tidbConfig.StoreGlobalConfig(toSet)
tidbConfig.UpdateGlobal(func(conf *tidbConfig.Config) {
// bypass wait time of https://github.com/pingcap/tidb/pull/20550
conf.TiKVClient.AsyncCommit.SafeWindow = 0
conf.TiKVClient.AsyncCommit.AllowedClockDrift = 0
})

if len(sessionCfg) == 0 {
sessionCfg = make(map[string]string)
Expand Down Expand Up @@ -112,6 +110,7 @@ func NewTracker(ctx context.Context, task string, sessionCfg map[string]string,

// avoid data race and of course no use in DM
domain.RunAutoAnalyze = false
session.DisableStats4Test()

dom, err := session.BootstrapSession(store)
if err != nil {
Expand Down

0 comments on commit 7ed0072

Please sign in to comment.