Skip to content

Commit

Permalink
bindinfo: change default behavior for bind cache
Browse files Browse the repository at this point in the history
Signed-off-by: Weizhen Wang <wangweizhen@pingcap.com>
  • Loading branch information
hawkingrei committed Mar 1, 2024
1 parent da7cd99 commit b070c94
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/bindinfo/binding_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,9 @@ func (c *bindingCache) get(key bindingCacheKey) Bindings {
if !hit {
return nil
}
if value == nil {
return nil
}
typedValue := value.(Bindings)
return typedValue
}
Expand All @@ -249,6 +252,7 @@ func (c *bindingCache) set(key bindingCacheKey, value Bindings) (ok bool, err er
return
}
c.memTracker.Consume(-calcBindCacheKVMem(evictedKey.(bindingCacheKey), evictedValue.(Bindings)))
c.cache.Put(evictedKey, nil)
}
c.memTracker.Consume(mem)
c.cache.Put(key, value)
Expand Down

0 comments on commit b070c94

Please sign in to comment.