From 68d385137a4729eb4466b5540bd464c834192700 Mon Sep 17 00:00:00 2001 From: congqixia Date: Mon, 27 Jun 2022 12:02:16 +0800 Subject: [PATCH] Fix: Miss channel info when load growing segment (#17789) (#17797) Signed-off-by: zhagnlu Co-authored-by: zhagnlu Signed-off-by: Congqi Xia Co-authored-by: zhagnlu <1542303831@qq.com> Co-authored-by: zhagnlu --- internal/querynode/segment_loader.go | 3 ++- internal/querynode/task.go | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/internal/querynode/segment_loader.go b/internal/querynode/segment_loader.go index a28799940..7f52eb0f2 100644 --- a/internal/querynode/segment_loader.go +++ b/internal/querynode/segment_loader.go @@ -120,6 +120,7 @@ func (loader *segmentLoader) LoadSegment(req *querypb.LoadSegmentsRequest, segme segmentID := info.SegmentID partitionID := info.PartitionID collectionID := info.CollectionID + vChannelID := info.InsertChannel collection, err := loader.metaReplica.getCollectionByID(collectionID) if err != nil { @@ -127,7 +128,7 @@ func (loader *segmentLoader) LoadSegment(req *querypb.LoadSegmentsRequest, segme return err } - segment, err := newSegment(collection, segmentID, partitionID, collectionID, "", segmentType) + segment, err := newSegment(collection, segmentID, partitionID, collectionID, vChannelID, segmentType) if err != nil { log.Error("load segment failed when create new segment", zap.Int64("collectionID", collectionID), diff --git a/internal/querynode/task.go b/internal/querynode/task.go index 26a8daf03..7cecb290e 100644 --- a/internal/querynode/task.go +++ b/internal/querynode/task.go @@ -177,13 +177,14 @@ func (w *watchDmChannelsTask) Execute(ctx context.Context) (err error) { ufInfo := w.req.SegmentInfos[ufInfoID] if len(ufInfo.Binlogs) > 0 { unFlushedSegments = append(unFlushedSegments, &queryPb.SegmentLoadInfo{ - SegmentID: ufInfo.ID, - PartitionID: ufInfo.PartitionID, - CollectionID: ufInfo.CollectionID, - BinlogPaths: ufInfo.Binlogs, - NumOfRows: ufInfo.NumOfRows, - Statslogs: ufInfo.Statslogs, - Deltalogs: ufInfo.Deltalogs, + SegmentID: ufInfo.ID, + PartitionID: ufInfo.PartitionID, + CollectionID: ufInfo.CollectionID, + BinlogPaths: ufInfo.Binlogs, + NumOfRows: ufInfo.NumOfRows, + Statslogs: ufInfo.Statslogs, + Deltalogs: ufInfo.Deltalogs, + InsertChannel: ufInfo.InsertChannel, }) unFlushedSegmentIDs = append(unFlushedSegmentIDs, ufInfo.ID) } -- GitLab