mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix proxy crash issue when meta cache miss (#19844)
issue: #19557 /kind bug Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com> Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>
This commit is contained in:
parent
3e11f2a700
commit
db33f401fd
@ -617,15 +617,15 @@ func (m *MetaCache) GetShards(ctx context.Context, withCache bool, collectionNam
|
||||
|
||||
shards := parseShardLeaderList2QueryNode(resp.GetShards())
|
||||
|
||||
// manipulate info in map, get map returns a copy of the information
|
||||
m.mu.RLock()
|
||||
info = m.collInfo[collectionName]
|
||||
info, err = m.GetCollectionInfo(ctx, collectionName)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get shards, collection %s not found", collectionName)
|
||||
}
|
||||
// lock leader
|
||||
info.leaderMutex.Lock()
|
||||
oldShards := info.shardLeaders
|
||||
info.shardLeaders = shards
|
||||
info.leaderMutex.Unlock()
|
||||
m.mu.RUnlock()
|
||||
|
||||
// update refcnt in shardClientMgr
|
||||
ret := info.CloneShardLeaders()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user