Skip to content

Commit

Permalink
fix review comment
Browse files Browse the repository at this point in the history
Signed-off-by: Wei Liu <[email protected]>
  • Loading branch information
weiliu1031 committed Nov 11, 2024
1 parent 08ee8b1 commit 557b161
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/proxy/meta_cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ func (m *MetaCache) DeprecateShardCache(database, collectionName string) {
if ok {
delete(dbInfo, collectionName)
if len(dbInfo) == 0 {
delete(dbInfo, database)
delete(m.collInfo, database)
}
}
}
Expand Down Expand Up @@ -1072,7 +1072,7 @@ func (m *MetaCache) InvalidateShardLeaderCache(collections []int64) {
}
}
if len(dbInfo) == 0 {
delete(dbInfo, dbName)
delete(m.collLeader, dbName)
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions internal/proxy/shard_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,12 @@ func (c *shardClientMgrImpl) PurgeClient() {
return
case <-ticker.C:
shardLocations := globalMetaCache.ListShardLocation()
for nodeID := range c.clients.data {
c.clients.Lock()
defer c.clients.Unlock()
for nodeID, client := range c.clients.data {
if _, ok := shardLocations[nodeID]; !ok {
c.clients.Lock()
client.Release()
delete(c.clients.data, nodeID)
c.clients.Unlock()
c.ReleaseClient(nodeID)
}
}
}
Expand Down

0 comments on commit 557b161

Please sign in to comment.