From 3e42487091ac304b83da2b5a0481a8e519a6e253 Mon Sep 17 00:00:00 2001 From: Yiding Date: Tue, 24 Dec 2024 00:26:10 +0800 Subject: [PATCH] undo the infoschema auto refresh --- pkg/domain/domain.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/pkg/domain/domain.go b/pkg/domain/domain.go index b428fe4c7290f..63c42ff8d30f5 100644 --- a/pkg/domain/domain.go +++ b/pkg/domain/domain.go @@ -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)) } @@ -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)) }