fix compacted segment delete buf block channel cp update(#23621) (#23782)

Signed-off-by: MrPresent-Han <jamesharden11122@gmail.com>
This commit is contained in:
MrPresent-Han 2023-04-28 00:24:36 +08:00 committed by GitHub
parent c82ec0b18a
commit aba2571fee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 8 deletions

View File

@ -683,7 +683,7 @@ func (c *ChannelMeta) getChannelCheckpoint(ttPos *internalpb.MsgPosition) *inter
if seg.curInsertBuf != nil && seg.curInsertBuf.startPos != nil && seg.curInsertBuf.startPos.Timestamp < channelCP.Timestamp {
channelCP = seg.curInsertBuf.startPos
}
if seg.curDeleteBuf != nil && seg.curDeleteBuf.startPos != nil && seg.curDeleteBuf.startPos.Timestamp < channelCP.Timestamp {
if !seg.isCompactedGenerated && seg.curDeleteBuf != nil && seg.curDeleteBuf.startPos != nil && seg.curDeleteBuf.startPos.Timestamp < channelCP.Timestamp {
channelCP = seg.curDeleteBuf.startPos
}
for _, ib := range seg.historyInsertBuf {

View File

@ -934,11 +934,12 @@ func (node *DataNode) SyncSegments(ctx context.Context, req *datapb.SyncSegments
// oneSegment is definitely in the channel, guaranteed by the check before.
collID, partID, _ := channel.getCollectionAndPartitionID(oneSegment)
targetSeg := &Segment{
collectionID: collID,
partitionID: partID,
segmentID: req.GetCompactedTo(),
numRows: req.GetNumOfRows(),
lastSyncTs: tsoutil.GetCurrentTime(),
collectionID: collID,
partitionID: partID,
segmentID: req.GetCompactedTo(),
numRows: req.GetNumOfRows(),
lastSyncTs: tsoutil.GetCurrentTime(),
isCompactedGenerated: true,
}
err = channel.InitPKstats(ctx, targetSeg, req.GetStatsLogs(), tsoutil.GetCurrentTime())

View File

@ -52,8 +52,9 @@ type Segment struct {
currentStat *storage.PkStatistics
historyStats []*storage.PkStatistics
lastSyncTs Timestamp
startPos *internalpb.MsgPosition // TODO readonly
lastSyncTs Timestamp
startPos *internalpb.MsgPosition // TODO readonly
isCompactedGenerated bool
}
type addSegmentReq struct {