Skip to content

Commit

Permalink
domain: randomly trigger the DumpStatsDeltaToKV (#48692) (#48703)
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 8ccc8a7 commit 643b328
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 @@ -1990,7 +1990,9 @@ func (do *Domain) syncIndexUsageWorker(owner owner.Manager) {
func (do *Domain) updateStatsWorker(ctx sessionctx.Context, owner owner.Manager) {
defer util.Recover(metrics.LabelDomain, "updateStatsWorker", nil, false)
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 643b328

Please sign in to comment.