Skip to content

Commit

Permalink
Fix proxy crash issue when meta cache miss (#19844)
Browse files Browse the repository at this point in the history
issue: #19557

/kind bug

Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>

Signed-off-by: Yuchen Gao <yuchen.gao@zilliz.com>
  • Loading branch information
soothing-rain authored Oct 18, 2022
1 parent 3e11f2a commit db33f40
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/proxy/meta_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit db33f40

Please sign in to comment.