Remove dependency for dropped segment checkpoint in querynode (#19831)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2022-10-17 18:47:25 +08:00 committed by GitHub
parent 9d43947f1c
commit a3f84f2ea3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ import (
"context" "context"
"errors" "errors"
"fmt" "fmt"
"math"
"runtime/debug" "runtime/debug"
"go.uber.org/zap" "go.uber.org/zap"
@ -319,18 +320,20 @@ func (w *watchDmChannelsTask) Execute(ctx context.Context) (err error) {
) )
// add excluded segments for dropped segments, // add excluded segments for dropped segments,
// dropped segments with later check point than seekPosition should be filtered out. // exclude all msgs with dropped segment id
droppedCheckPointInfos := make([]*datapb.SegmentInfo, 0) // DO NOT refer to dropped segment info, see issue https://github.com/milvus-io/milvus/issues/19704
var droppedCheckPointInfos []*datapb.SegmentInfo
for _, info := range w.req.Infos { for _, info := range w.req.Infos {
for _, droppedSegmentID := range info.GetDroppedSegmentIds() { for _, droppedSegmentID := range info.GetDroppedSegmentIds() {
droppedSegment := w.req.SegmentInfos[droppedSegmentID] droppedCheckPointInfos = append(droppedCheckPointInfos, &datapb.SegmentInfo{
for _, position := range channel2SeekPosition { ID: droppedSegmentID,
if droppedSegment != nil && CollectionID: collectionID,
droppedSegment.DmlPosition.ChannelName == position.ChannelName && InsertChannel: info.GetChannelName(),
droppedSegment.DmlPosition.Timestamp > position.Timestamp { DmlPosition: &internalpb.MsgPosition{
droppedCheckPointInfos = append(droppedCheckPointInfos, droppedSegment) ChannelName: info.GetChannelName(),
} Timestamp: math.MaxUint64,
} },
})
} }
} }
w.node.metaReplica.addExcludedSegments(collectionID, droppedCheckPointInfos) w.node.metaReplica.addExcludedSegments(collectionID, droppedCheckPointInfos)