mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-30 02:48:45 +08:00
Modify segment seal policy with number of statslog files (#21957)
Signed-off-by: jaime <yun.zhang@zilliz.com>
This commit is contained in:
parent
f295caf05e
commit
748a935a11
@ -291,9 +291,9 @@ dataCoord:
|
||||
# `minSizeFromIdleToSealed`, Milvus will automatically seal it.
|
||||
maxIdleTime: 600 # The max idle time of segment in seconds, 10*60.
|
||||
minSizeFromIdleToSealed: 16 # The min size in MB of segment which can be idle from sealed.
|
||||
# The max number of binlog file for one segment, the segment will be sealed if
|
||||
# the number of binlog file reaches to max value.
|
||||
maxBinlogFileNumber: 256
|
||||
# The max number of statslog file for one segment, the segment will be sealed if
|
||||
# the number of statslog file reaches to max value.
|
||||
maxBinlogFileNumber: 16
|
||||
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
|
||||
|
@ -130,7 +130,7 @@ func sealByLifetimePolicy(lifetime time.Duration) segmentSealPolicy {
|
||||
func sealByMaxBinlogFileNumberPolicy(maxBinlogFileNumber int) segmentSealPolicy {
|
||||
return func(segment *SegmentInfo, ts Timestamp) bool {
|
||||
logFileCounter := 0
|
||||
for _, fieldBinlog := range segment.Binlogs {
|
||||
for _, fieldBinlog := range segment.GetStatslogs() {
|
||||
logFileCounter += len(fieldBinlog.GetBinlogs())
|
||||
}
|
||||
|
||||
|
@ -554,7 +554,7 @@ func TestTryToSealSegment(t *testing.T) {
|
||||
segments := segmentManager.meta.segments.segments
|
||||
assert.Equal(t, 1, len(segments))
|
||||
for _, seg := range segments {
|
||||
seg.Binlogs = []*datapb.FieldBinlog{
|
||||
seg.Statslogs = []*datapb.FieldBinlog{
|
||||
{
|
||||
FieldID: 2,
|
||||
Binlogs: []*datapb.Binlog{
|
||||
@ -579,7 +579,7 @@ func TestTryToSealSegment(t *testing.T) {
|
||||
segments := segmentManager.meta.segments.segments
|
||||
assert.Equal(t, 1, len(segments))
|
||||
for _, seg := range segments {
|
||||
seg.Binlogs = []*datapb.FieldBinlog{
|
||||
seg.Statslogs = []*datapb.FieldBinlog{
|
||||
{
|
||||
FieldID: 1,
|
||||
Binlogs: []*datapb.Binlog{
|
||||
|
@ -1467,8 +1467,8 @@ func (p *dataCoordConfig) init(base *BaseTable) {
|
||||
|
||||
p.SegmentMaxBinlogFileNumber = ParamItem{
|
||||
Key: "dataCoord.segment.maxBinlogFileNumber",
|
||||
Version: "2.0.0",
|
||||
DefaultValue: "256",
|
||||
Version: "2.2.0",
|
||||
DefaultValue: "16",
|
||||
}
|
||||
p.SegmentMaxBinlogFileNumber.Init(base.mgr)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user