Skip to content

Commit

Permalink
revise log
Browse files Browse the repository at this point in the history
Signed-off-by: yisaer <[email protected]>
  • Loading branch information
Yisaer committed May 17, 2022
1 parent e255739 commit aead383
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 6 additions & 2 deletions domain/sysvar_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ func (do *Domain) rebuildSysVarCache(ctx sessionctx.Context) error {
if sv.HasGlobalScope() {
newGlobalCache[sv.Name] = sVal

oldStatsCacheMemQuota := variable.StatsCacheMemQuota.Load()

// Call the SetGlobal func for this sysvar if it exists.
// SET GLOBAL only calls the SetGlobal func on the calling instances.
// This ensures it is run on all tidb servers.
Expand All @@ -149,8 +151,10 @@ func (do *Domain) rebuildSysVarCache(ctx sessionctx.Context) error {
if err != nil {
logutil.BgLogger().Error(fmt.Sprintf("load global variable %s error", sv.Name), zap.Error(err))
}
if sv.Name == variable.TiDBStatsCacheMemQuota {
do.SetStatsCacheCapacity(variable.StatsCacheMemQuota.Load())

newStatsCacheMemQuota := variable.StatsCacheMemQuota.Load()
if sv.Name == variable.TiDBStatsCacheMemQuota && oldStatsCacheMemQuota != newStatsCacheMemQuota {
do.SetStatsCacheCapacity(newStatsCacheMemQuota)
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions statistics/handle/lru_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ package handle

import (
"container/list"
"github.com/pingcap/tidb/util/logutil"
"go.uber.org/zap"
"math"
"sync"

Expand Down Expand Up @@ -391,6 +393,8 @@ func (c *innerItemLruCache) evictIfNeeded() {
if c.onEvict != nil {
c.onEvict(item.tblID)
}
logutil.BgLogger().Info("stats cache lru got evicted", zap.Int64("table-id", item.tblID),
zap.Bool("isIndex", true), zap.Int64("id", item.id))
curr = prev
}
}
Expand Down

0 comments on commit aead383

Please sign in to comment.