fix: Return all targets segments in ListLoadedSegments (#42728)

issue: https://github.com/milvus-io/milvus/issues/42412

Signed-off-by: sunby <sunbingyi1992@gmail.com>
This commit is contained in:
Bingyi Sun 2025-06-18 11:20:38 +08:00 committed by GitHub
parent 69be718105
commit 6bebb68727
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1250,7 +1250,11 @@ func (s *Server) ListLoadedSegments(ctx context.Context, req *querypb.ListLoaded
collections := s.meta.GetAllCollections(ctx)
for _, collection := range collections {
segments := s.targetMgr.GetSealedSegmentsByCollection(ctx, collection.GetCollectionID(), meta.CurrentTargetFirst)
segments := s.targetMgr.GetSealedSegmentsByCollection(ctx, collection.GetCollectionID(), meta.CurrentTarget)
for _, segment := range segments {
segmentIDs.Insert(segment.ID)
}
segments = s.targetMgr.GetSealedSegmentsByCollection(ctx, collection.GetCollectionID(), meta.NextTarget)
for _, segment := range segments {
segmentIDs.Insert(segment.ID)
}