Skip to content

Commit

Permalink
undo the infoschema auto refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
winoros committed Dec 23, 2024
1 parent 3288508 commit 3e42487
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions pkg/domain/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -2591,16 +2591,16 @@ func (do *Domain) loadStatsWorker() {
for {
select {
case <-loadTicker.C:
count := 0
// count := 0
is := do.InfoSchema()
getIS := func() infoschema.InfoSchema {
count++
if count%100 == 0 {
is = do.InfoSchema()
}
return is
}
err = statsHandle.UpdateWithInfoSchemaAutoRefresh(ctx, getIS)
// getIS := func() infoschema.InfoSchema {
// count++
// if count%100 == 0 {
// is = do.InfoSchema()
// }
// return is
// }
err = statsHandle.Update(ctx, is)
if err != nil {
logutil.BgLogger().Warn("update stats info failed", zap.Error(err))
}
Expand Down Expand Up @@ -2718,16 +2718,16 @@ func (do *Domain) updateStatsWorker(_ sessionctx.Context) {
if !do.statsOwner.IsOwner() {
continue
}
count := 0
// count := 0
is := do.InfoSchema()
getIS := func() infoschema.InfoSchema {
count++
if count%100 == 0 {
is = do.InfoSchema()
}
return is
}
err := statsHandle.GCStatsWithInfoSchemaAutoRefresh(getIS, do.GetSchemaLease())
// getIS := func() infoschema.InfoSchema {
// count++
// if count%100 == 0 {
// is = do.InfoSchema()
// }
// return is
// }
err := statsHandle.GCStats(is, do.GetSchemaLease())
if err != nil {
logutil.BgLogger().Warn("GC stats failed", zap.Error(err))
}
Expand Down

0 comments on commit 3e42487

Please sign in to comment.