diff --git a/statistics/handle/update.go b/statistics/handle/update.go index 78dfa5878324a..7cdc3267965c2 100644 --- a/statistics/handle/update.go +++ b/statistics/handle/update.go @@ -234,9 +234,6 @@ func (s *SessionStatsCollector) UpdateColStatsUsage(colMap colStatsUsageMap) { // NewSessionStatsCollector allocates a stats collector for a session. func (h *Handle) NewSessionStatsCollector() *SessionStatsCollector { - h.mu.Lock() - defer h.mu.Unlock() - h.listHead.Lock() defer h.listHead.Unlock() newCollector := &SessionStatsCollector{ @@ -315,8 +312,6 @@ func (s *SessionIndexUsageCollector) Delete() { // idxUsageListHead always points to an empty SessionIndexUsageCollector as a sentinel node. So we let idxUsageListHead.next // points to new item. It's helpful to sweepIdxUsageList. func (h *Handle) NewSessionIndexUsageCollector() *SessionIndexUsageCollector { - h.mu.Lock() - defer h.mu.Unlock() h.idxUsageListHead.Lock() defer h.idxUsageListHead.Unlock() newCollector := &SessionIndexUsageCollector{