Fix data race in MetaCache (#24739)

Signed-off-by: yah01 <yang.cen@zilliz.com>
This commit is contained in:
yah01 2023-06-08 13:58:35 +08:00 committed by GitHub
parent d6dea8bcbb
commit fa69c71d35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -384,6 +384,8 @@ func (m *MetaCache) GetPartitions(ctx context.Context, collectionName string) (m
metrics.ProxyCacheStatsCounter.WithLabelValues(strconv.FormatInt(paramtable.GetNodeID(), 10), "GetPartitions", metrics.CacheHitLabel).Inc()
ret := make(map[string]typeutil.UniqueID)
m.mu.RLock()
defer m.mu.RUnlock()
partInfo := m.collInfo[collectionName].partInfo
for k, v := range partInfo {
ret[k] = v.partitionID