fix: Fill deltalog entry num & time range in L0 compactions (#33004)

Resolves #33003

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

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/33008/head
congqixia 2024-05-13 14:13:31 +08:00 committed by GitHub
parent 4724779b3b
commit 12ec3d61d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 18 additions and 4 deletions

View File

@ -19,6 +19,7 @@ package datanode
import ( import (
"context" "context"
"fmt" "fmt"
"math"
"time" "time"
"github.com/samber/lo" "github.com/samber/lo"
@ -330,11 +331,24 @@ func (t *levelZeroCompactionTask) composeDeltalog(segmentID int64, dData *storag
uploadKv[blobPath] = blob.GetValue() uploadKv[blobPath] = blob.GetValue()
// TODO Timestamp? minTs := uint64(math.MaxUint64)
maxTs := uint64(0)
for _, ts := range dData.Tss {
if ts > maxTs {
maxTs = ts
}
if ts < minTs {
minTs = ts
}
}
deltalog := &datapb.Binlog{ deltalog := &datapb.Binlog{
EntriesNum: dData.RowCount,
LogSize: int64(len(blob.GetValue())), LogSize: int64(len(blob.GetValue())),
LogPath: blobPath, LogPath: blobPath,
LogID: logID, LogID: logID,
TimestampFrom: minTs,
TimestampTo: maxTs,
} }
return uploadKv, deltalog, nil return uploadKv, deltalog, nil