Skip to content

Commit

Permalink
tracker: disable background statistic job (pingcap#2065) (pingcap#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored and lichunzhu committed Sep 16, 2021
1 parent d2051ed commit 7ce19d4
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions pkg/schema/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,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
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 @@ -111,6 +111,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 7ce19d4

Please sign in to comment.