enhance: [Cherry-Pick] UpdateSegmentsInfo should update remaining segment info even if some one not exist (#36729)

pr: https://github.com/milvus-io/milvus/pull/36726

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
aoiasd 2024-10-10 15:11:20 +08:00 committed by GitHub
parent 02bd916fa4
commit eaa948752b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1001,10 +1001,12 @@ func (m *meta) UpdateSegmentsInfo(operators ...UpdateOperator) error {
}
for _, operator := range operators {
ok := operator(updatePack)
if !ok {
return nil
}
operator(updatePack)
}
// skip if all segment not exist
if len(updatePack.segments) == 0 {
return nil
}
segments := lo.MapToSlice(updatePack.segments, func(_ int64, segment *SegmentInfo) *datapb.SegmentInfo { return segment.SegmentInfo })