From a5f98e4cb3caddd27e946f055d88f562d9d857a5 Mon Sep 17 00:00:00 2001 From: aoiasd <45024769+aoiasd@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:17:19 +0800 Subject: [PATCH] enhance: UpdateSegmentsInfo should update remaining segment info even if some one not exist (#36726) Signed-off-by: aoiasd --- internal/datacoord/meta.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/internal/datacoord/meta.go b/internal/datacoord/meta.go index 037928fa78c97..74d836d116e2c 100644 --- a/internal/datacoord/meta.go +++ b/internal/datacoord/meta.go @@ -1011,10 +1011,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 })