mirror of https://github.com/milvus-io/milvus.git
enhance: [10kcp] remove unnecessary clone in meta cache (#38398)
issue: https://github.com/milvus-io/milvus/issues/36627, https://github.com/milvus-io/milvus/issues/37630 pr: https://github.com/milvus-io/milvus/pull/36628 Signed-off-by: bigsheeper <yihao.dai@zilliz.com> Co-authored-by: Ted Xu <ted.xu@zilliz.com>pull/38433/head
parent
5521091dcd
commit
11118db7d6
|
@ -346,26 +346,24 @@ func GetSegmentsChanPart(m *meta, filters ...SegmentFilter) []*chanPartSegments
|
|||
mDimEntry := make(map[dim]*chanPartSegments)
|
||||
|
||||
candidates := m.SelectSegments(filters...)
|
||||
for _, segmentInfo := range candidates {
|
||||
cloned := segmentInfo.Clone()
|
||||
|
||||
d := dim{cloned.PartitionID, cloned.InsertChannel}
|
||||
for _, si := range candidates {
|
||||
d := dim{si.PartitionID, si.InsertChannel}
|
||||
entry, ok := mDimEntry[d]
|
||||
if !ok {
|
||||
entry = &chanPartSegments{
|
||||
collectionID: cloned.CollectionID,
|
||||
partitionID: cloned.PartitionID,
|
||||
channelName: cloned.InsertChannel,
|
||||
collectionID: si.CollectionID,
|
||||
partitionID: si.PartitionID,
|
||||
channelName: si.InsertChannel,
|
||||
}
|
||||
mDimEntry[d] = entry
|
||||
}
|
||||
entry.segments = append(entry.segments, cloned)
|
||||
entry.segments = append(entry.segments, si)
|
||||
}
|
||||
|
||||
result := make([]*chanPartSegments, 0, len(mDimEntry))
|
||||
for _, entry := range mDimEntry {
|
||||
result = append(result, entry)
|
||||
}
|
||||
log.Debug("GetSegmentsChanPart", zap.Int("length", len(result)))
|
||||
return result
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue