Skip to content

Commit

Permalink
domain: randomly trigger the DumpStatsDeltaToKV (#48692) (#48704)
Browse files Browse the repository at this point in the history
close #48693
  • Loading branch information
ti-chi-bot authored Nov 20, 2023
1 parent 21db91b commit 5232881
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2324,7 +2324,9 @@ func (do *Domain) updateStatsWorker(ctx sessionctx.Context, owner owner.Manager)
defer util.Recover(metrics.LabelDomain, "updateStatsWorker", nil, false)
logutil.BgLogger().Info("updateStatsWorker started.")
lease := do.statsLease
deltaUpdateTicker := time.NewTicker(20 * lease)
// We need to have different nodes trigger tasks at different times to avoid the herd effect.
randDuration := time.Duration(rand.Int63n(int64(time.Minute)))
deltaUpdateTicker := time.NewTicker(20*lease + randDuration)
gcStatsTicker := time.NewTicker(100 * lease)
dumpFeedbackTicker := time.NewTicker(200 * lease)
loadFeedbackTicker := time.NewTicker(5 * lease)
Expand Down

0 comments on commit 5232881

Please sign in to comment.