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

tracker: disable background statistic job #2065

Merged
merged 2 commits into from
Aug 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions pkg/schema/tracker.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +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
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 @@ -110,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