mirror of https://github.com/milvus-io/milvus.git
modify a segment seal policy with number of statslog files (#21951)
Signed-off-by: jaime <yun.zhang@zilliz.com>pull/22063/head
parent
1a65f1e01c
commit
14858adc95
|
@ -281,7 +281,7 @@ dataCoord:
|
|||
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
|
||||
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.85 # 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())
|
||||
}
|
||||
|
||||
|
|
|
@ -524,7 +524,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{
|
||||
|
@ -549,7 +549,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{
|
||||
|
|
|
@ -1296,7 +1296,7 @@ func (p *dataCoordConfig) initSegmentMinSizeFromIdleToSealed() {
|
|||
}
|
||||
|
||||
func (p *dataCoordConfig) initSegmentMaxBinlogFileNumber() {
|
||||
p.SegmentMaxBinlogFileNumber = p.Base.ParseIntWithDefault("dataCoord.segment.maxBinlogFileNumber", 256)
|
||||
p.SegmentMaxBinlogFileNumber = p.Base.ParseIntWithDefault("dataCoord.segment.maxBinlogFileNumber", 16)
|
||||
log.Info("init segment max binlog file to sealed", zap.Int("value", p.SegmentMaxBinlogFileNumber))
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue