Skip to content

Commit

Permalink
fix: Do compressBinlog to fix logID 0 (#34060)
Browse files Browse the repository at this point in the history
issue: #34059

Do compressBinlog to ensure that reloadFromKV will fill binlogs' logID
after datacoord restarts.

---------

Signed-off-by: bigsheeper <yihao.dai@zilliz.com>
  • Loading branch information
bigsheeper committed Jun 22, 2024
1 parent e0e06fc commit fb870d2
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions internal/metastore/kv/datacoord/kv_catalog.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,29 +217,23 @@ func (kc *Catalog) applyBinlogInfo(segments []*datapb.SegmentInfo, insertLogs, d
for _, segmentInfo := range segments {
if len(segmentInfo.Binlogs) == 0 {
segmentInfo.Binlogs = insertLogs[segmentInfo.ID]
} else {
err = binlog.CompressFieldBinlogs(segmentInfo.Binlogs)
if err != nil {
return err
}
}
if err = binlog.CompressFieldBinlogs(segmentInfo.Binlogs); err != nil {
return err
}

if len(segmentInfo.Deltalogs) == 0 {
segmentInfo.Deltalogs = deltaLogs[segmentInfo.ID]
} else {
err = binlog.CompressFieldBinlogs(segmentInfo.Deltalogs)
if err != nil {
return err
}
}
if err = binlog.CompressFieldBinlogs(segmentInfo.Deltalogs); err != nil {
return err
}

if len(segmentInfo.Statslogs) == 0 {
segmentInfo.Statslogs = statsLogs[segmentInfo.ID]
} else {
err = binlog.CompressFieldBinlogs(segmentInfo.Statslogs)
if err != nil {
return err
}
}
if err = binlog.CompressFieldBinlogs(segmentInfo.Statslogs); err != nil {
return err
}
}
return nil
Expand Down

0 comments on commit fb870d2

Please sign in to comment.