mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-07 19:31:51 +08:00
Fix invalid single compaction (#21329)
Signed-off-by: xige-16 <xi.ge@zilliz.com>
This commit is contained in:
parent
9266b527a9
commit
e43dbe1c38
@ -281,7 +281,7 @@ dataCoord:
|
||||
minSizeFromIdleToSealed: 16 # The min size in MB of segment which can be idle from sealed.
|
||||
smallProportion: 0.5 # The segment is considered as "small segment" when its # of rows is smaller than
|
||||
# (smallProportion * segment max # of rows).
|
||||
compactableProportion: 0.5 # A compaction will happen on small segments if the segment after compaction will have
|
||||
compactableProportion: 0.85 # A compaction will happen on small segments if the segment after compaction will have
|
||||
# over (compactableProportion * segment max # of rows) rows.
|
||||
|
||||
compaction:
|
||||
|
||||
@ -1243,8 +1243,7 @@ func (p *dataCoordConfig) init(base *BaseTable) {
|
||||
|
||||
p.initCompactionMinSegment()
|
||||
p.initCompactionMaxSegment()
|
||||
p.initSegmentSmallProportion()
|
||||
p.initSegmentCompactableProportion()
|
||||
p.initSegmentProportion()
|
||||
p.initCompactionTimeoutInSeconds()
|
||||
p.initCompactionCheckIntervalInSeconds()
|
||||
p.initSingleCompactionRatioThreshold()
|
||||
@ -1321,7 +1320,17 @@ func (p *dataCoordConfig) initSegmentSmallProportion() {
|
||||
}
|
||||
|
||||
func (p *dataCoordConfig) initSegmentCompactableProportion() {
|
||||
p.SegmentCompactableProportion = p.Base.ParseFloatWithDefault("dataCoord.segment.compactableProportion", 0.5)
|
||||
p.SegmentCompactableProportion = p.Base.ParseFloatWithDefault("dataCoord.segment.compactableProportion", 0.85)
|
||||
}
|
||||
|
||||
func (p *dataCoordConfig) initSegmentProportion() {
|
||||
p.initSegmentSmallProportion()
|
||||
p.initSegmentCompactableProportion()
|
||||
|
||||
// avoid invalid single compaction
|
||||
if p.SegmentCompactableProportion < p.SegmentSmallProportion {
|
||||
p.SegmentCompactableProportion = p.SegmentSmallProportion
|
||||
}
|
||||
}
|
||||
|
||||
// compaction execution timeout
|
||||
|
||||
@ -290,6 +290,7 @@ func TestComponentParam(t *testing.T) {
|
||||
assert.Equal(t, 24*60*60*time.Second, Params.SegmentMaxLifetime)
|
||||
assert.True(t, Params.EnableGarbageCollection)
|
||||
assert.Equal(t, Params.EnableActiveStandby, false)
|
||||
assert.True(t, Params.SegmentCompactableProportion >= Params.SegmentSmallProportion)
|
||||
t.Logf("dataCoord EnableActiveStandby = %t", Params.EnableActiveStandby)
|
||||
})
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user