diff --git a/internal/proxy/meta_cache.go b/internal/proxy/meta_cache.go index bf3c1a48d6..b9514091de 100644 --- a/internal/proxy/meta_cache.go +++ b/internal/proxy/meta_cache.go @@ -1002,8 +1002,8 @@ func (m *MetaCache) DeprecateShardCache(database, collectionName string) { func (m *MetaCache) InvalidateShardLeaderCache(collections []int64) { log.Info("Invalidate shard cache for collections", zap.Int64s("collectionIDs", collections)) - m.mu.RLock() - defer m.mu.RUnlock() + m.leaderMut.Lock() + defer m.leaderMut.Unlock() collectionSet := typeutil.NewUniqueSet(collections...) for _, db := range m.collLeader {