diff --git a/internal/metastore/kv/datacoord/kv_catalog.go b/internal/metastore/kv/datacoord/kv_catalog.go index a7cae134c9..4272458cc3 100644 --- a/internal/metastore/kv/datacoord/kv_catalog.go +++ b/internal/metastore/kv/datacoord/kv_catalog.go @@ -219,29 +219,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