fix consume growing from dml after release (#25421)

Signed-off-by: Wei Liu <wei.liu@zilliz.com>
pull/25460/head
wei liu 2023-07-10 17:36:28 +08:00 committed by GitHub
parent aaac1e27d1
commit cc730c1ee5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 15 additions and 0 deletions

View File

@ -610,6 +610,21 @@ func (node *QueryNode) ReleaseSegments(ctx context.Context, req *querypb.Release
return util.WrapStatus(commonpb.ErrorCode_UnexpectedError, msg), nil
}
// when we try to release a segment, add it to pipeline's exclude list first
// in case of consumed it's growing segment again
pipeline := node.pipelineManager.Get(req.GetShard())
if pipeline != nil {
droppedInfos := lo.Map(req.GetSegmentIDs(), func(id int64, _ int) *datapb.SegmentInfo {
return &datapb.SegmentInfo{
ID: id,
DmlPosition: &msgpb.MsgPosition{
Timestamp: typeutil.MaxTimestamp,
},
}
})
pipeline.ExcludedSegments(droppedInfos...)
}
req.NeedTransfer = false
err := delegator.ReleaseSegments(ctx, req, false)
if err != nil {