mirror of https://github.com/milvus-io/milvus.git
Fix compaction produces empty segment (#19936)
Signed-off-by: yah01 <yang.cen@zilliz.com> Signed-off-by: yah01 <yang.cen@zilliz.com>pull/19912/head
parent
5350b4aef5
commit
e8ca754dca
|
@ -255,9 +255,13 @@ func (c *compactionPlanHandler) handleMergeCompactionResult(plan *datapb.Compact
|
|||
}
|
||||
|
||||
log.Debug("handleCompactionResult: altering metastore after compaction")
|
||||
if err := c.meta.alterMetaStoreAfterCompaction(modInfos, newSegment.SegmentInfo); err != nil {
|
||||
log.Warn("handleCompactionResult: fail to alter metastore after compaction", zap.Error(err))
|
||||
return fmt.Errorf("fail to alter metastore after compaction, err=%w", err)
|
||||
if newSegment.GetNumOfRows() > 0 {
|
||||
if err := c.meta.alterMetaStoreAfterCompaction(modInfos, newSegment.SegmentInfo); err != nil {
|
||||
log.Warn("handleCompactionResult: fail to alter metastore after compaction", zap.Error(err))
|
||||
return fmt.Errorf("fail to alter metastore after compaction, err=%w", err)
|
||||
}
|
||||
} else {
|
||||
log.Warn("compaction produced an empty segment")
|
||||
}
|
||||
|
||||
var nodeID = c.plans[plan.GetPlanID()].dataNodeID
|
||||
|
|
Loading…
Reference in New Issue