mirror of https://github.com/milvus-io/milvus.git
fix: Proxy crash due to shard leader cache data race (#32971)
issue: #32970 cause InvalidateShardLeaderCache use wrong lock, which may cause data race in meta cache, then proxy may crash This PR fixed that use leaderMut when try to access shard leader cache. Signed-off-by: Wei Liu <wei.liu@zilliz.com>pull/32818/head^2
parent
36f1ea93a5
commit
8a9a42198d
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue