diff --git a/internal/querycoordv2/utils/types.go b/internal/querycoordv2/utils/types.go index 095fc65f2b..aa4481cd34 100644 --- a/internal/querycoordv2/utils/types.go +++ b/internal/querycoordv2/utils/types.go @@ -60,19 +60,14 @@ func MergeMetaSegmentIntoSegmentInfo(info *querypb.SegmentInfo, segments ...*met // packSegmentLoadInfo packs SegmentLoadInfo for given segment, // packs with index if withIndex is true, this fetch indexes from IndexCoord func PackSegmentLoadInfo(segment *datapb.SegmentInfo, channelCheckpoint *msgpb.MsgPosition, indexes []*querypb.FieldIndexInfo) *querypb.SegmentLoadInfo { - checkpoint := segment.GetDmlPosition() - if channelCheckpoint.GetTimestamp() > checkpoint.GetTimestamp() { - checkpoint = channelCheckpoint - } - - posTime := tsoutil.PhysicalTime(checkpoint.GetTimestamp()) + posTime := tsoutil.PhysicalTime(channelCheckpoint.GetTimestamp()) tsLag := time.Since(posTime) if tsLag >= 10*time.Minute { log.Warn("delta position is quite stale", zap.Int64("collectionID", segment.GetCollectionID()), zap.Int64("segmentID", segment.GetID()), zap.String("channel", segment.InsertChannel), - zap.Uint64("posTs", checkpoint.GetTimestamp()), + zap.Uint64("posTs", channelCheckpoint.GetTimestamp()), zap.Time("posTime", posTime), zap.Duration("tsLag", tsLag)) } @@ -87,7 +82,7 @@ func PackSegmentLoadInfo(segment *datapb.SegmentInfo, channelCheckpoint *msgpb.M InsertChannel: segment.InsertChannel, IndexInfos: indexes, StartPosition: segment.GetStartPosition(), - DeltaPosition: checkpoint, + DeltaPosition: channelCheckpoint, Level: segment.GetLevel(), StorageVersion: segment.GetStorageVersion(), } diff --git a/internal/querycoordv2/utils/types_test.go b/internal/querycoordv2/utils/types_test.go index e4f0d1cb11..2376f55693 100644 --- a/internal/querycoordv2/utils/types_test.go +++ b/internal/querycoordv2/utils/types_test.go @@ -80,6 +80,6 @@ func Test_packLoadSegmentRequest(t *testing.T) { req := PackSegmentLoadInfo(segmentInfo, channel.GetSeekPosition(), nil) assert.NotNil(t, req.GetDeltaPosition()) assert.Equal(t, mockPChannel, req.GetDeltaPosition().ChannelName) - assert.Equal(t, segmentInfo.GetDmlPosition().GetTimestamp(), req.GetDeltaPosition().GetTimestamp()) + assert.Equal(t, channel.SeekPosition.Timestamp, req.GetDeltaPosition().GetTimestamp()) }) }