diff --git a/configs/milvus.yaml b/configs/milvus.yaml index 45398b2238..313781d2b9 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -287,6 +287,7 @@ dataCoord: # (smallProportion * segment max # of rows). compactableProportion: 0.5 # A compaction will happen on small segments if the segment after compaction will have # over (compactableProportion * segment max # of rows) rows. + # MUST BE GREATER THAN OR EQUAL TO !!! expansionRate: 1.25 # During compaction, the size of segment # of rows is able to exceed segment max # of rows by (expansionRate-1) * 100%. compaction: diff --git a/internal/datacoord/compaction_trigger.go b/internal/datacoord/compaction_trigger.go index eb83791925..4ead43be5a 100644 --- a/internal/datacoord/compaction_trigger.go +++ b/internal/datacoord/compaction_trigger.go @@ -613,7 +613,8 @@ func (t *compactionTrigger) generatePlans(segments []*SegmentInfo, force bool, i } // only merge if candidate number is large than MinSegmentToMerge or if target row is large enough if len(bucket) >= Params.DataCoordCfg.MinSegmentToMerge.GetAsInt() || - targetRow > int64(float64(segment.GetMaxRowNum())*Params.DataCoordCfg.SegmentCompactableProportion.GetAsFloat()) { + len(bucket) > 1 && + targetRow > int64(float64(segment.GetMaxRowNum())*Params.DataCoordCfg.SegmentCompactableProportion.GetAsFloat()) { plan := segmentsToPlan(bucket, compactTime) log.Info("generate a plan for small candidates", zap.Int64s("plan segment IDs", lo.Map(bucket, getSegmentIDs)),