mirror of https://github.com/milvus-io/milvus.git
Rename params in data_coord.yaml (#5968)
Signed-off-by: sunby <bingyi.sun@zilliz.com>pull/5979/head^2
parent
d5f4ee6f44
commit
d2c8462dac
|
@ -24,5 +24,7 @@ func main() {
|
|||
}
|
||||
if err := storage.PrintBinlogFiles(os.Args[1:]); err != nil {
|
||||
fmt.Printf("error: %s\n", err.Error())
|
||||
} else {
|
||||
fmt.Printf("print binlog complete.\n")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@
|
|||
|
||||
datacoord:
|
||||
segment:
|
||||
size: 512 # MB
|
||||
sizeFactor: 0.75
|
||||
IDAssignExpiration: 2000 # ms
|
||||
maxSize: 512 # MB
|
||||
sealProportion: 0.75
|
||||
assignmentExpiration: 2000 # ms
|
|
@ -42,9 +42,9 @@ type ParamTable struct {
|
|||
StatsStreamPosSubPath string
|
||||
|
||||
// segment
|
||||
SegmentSize float64
|
||||
SegmentSizeFactor float64
|
||||
SegIDAssignExpiration int64
|
||||
SegmentMaxSize float64
|
||||
SegmentSealProportion float64
|
||||
SegAssignmentExpiration int64
|
||||
|
||||
InsertChannelPrefixName string
|
||||
StatisticsChannelName string
|
||||
|
@ -63,7 +63,7 @@ func (p *ParamTable) Init() {
|
|||
// load yaml
|
||||
p.BaseTable.Init()
|
||||
|
||||
if err := p.LoadYaml("advanced/data_service.yaml"); err != nil {
|
||||
if err := p.LoadYaml("advanced/data_coord.yaml"); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
|
@ -76,9 +76,9 @@ func (p *ParamTable) Init() {
|
|||
|
||||
p.initPulsarAddress()
|
||||
|
||||
p.initSegmentSize()
|
||||
p.initSegmentSizeFactor()
|
||||
p.initSegIDAssignExpiration()
|
||||
p.initSegmentMaxSize()
|
||||
p.initSegmentSealProportion()
|
||||
p.initSegAssignmentExpiration()
|
||||
p.initInsertChannelPrefixName()
|
||||
p.initStatisticsChannelName()
|
||||
p.initTimeTickChannelName()
|
||||
|
@ -147,16 +147,16 @@ func (p *ParamTable) initCollectionBinlogSubPath() {
|
|||
p.CollectionBinlogSubPath = subPath
|
||||
}
|
||||
|
||||
func (p *ParamTable) initSegmentSize() {
|
||||
p.SegmentSize = p.ParseFloat("datacoord.segment.size")
|
||||
func (p *ParamTable) initSegmentMaxSize() {
|
||||
p.SegmentMaxSize = p.ParseFloat("datacoord.segment.maxSize")
|
||||
}
|
||||
|
||||
func (p *ParamTable) initSegmentSizeFactor() {
|
||||
p.SegmentSizeFactor = p.ParseFloat("datacoord.segment.sizeFactor")
|
||||
func (p *ParamTable) initSegmentSealProportion() {
|
||||
p.SegmentSealProportion = p.ParseFloat("datacoord.segment.sealProportion")
|
||||
}
|
||||
|
||||
func (p *ParamTable) initSegIDAssignExpiration() {
|
||||
p.SegIDAssignExpiration = p.ParseInt64("datacoord.segment.IDAssignExpiration") //ms
|
||||
func (p *ParamTable) initSegAssignmentExpiration() {
|
||||
p.SegAssignmentExpiration = p.ParseInt64("datacoord.segment.assignmentExpiration")
|
||||
}
|
||||
|
||||
func (p *ParamTable) initInsertChannelPrefixName() {
|
||||
|
|
|
@ -31,7 +31,7 @@ func (p *calBySchemaPolicy) apply(schema *schemapb.CollectionSchema) (int, error
|
|||
if err != nil {
|
||||
return -1, err
|
||||
}
|
||||
threshold := Params.SegmentSize * 1024 * 1024
|
||||
threshold := Params.SegmentMaxSize * 1024 * 1024
|
||||
return int(threshold / float64(sizePerRecord)), nil
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ type sealPolicyV1 struct {
|
|||
}
|
||||
|
||||
func (p *sealPolicyV1) apply(maxCount, writtenCount, allocatedCount int64) bool {
|
||||
return float64(writtenCount) >= Params.SegmentSizeFactor*float64(maxCount)
|
||||
return float64(writtenCount) >= Params.SegmentSealProportion*float64(maxCount)
|
||||
}
|
||||
|
||||
func newSealPolicyV1() sealPolicy {
|
||||
|
|
|
@ -162,7 +162,7 @@ func defaultSealPolicy() sealPolicy {
|
|||
}
|
||||
|
||||
func defaultSegmentSealPolicy() segmentSealPolicy {
|
||||
return getSegmentCapacityPolicy(Params.SegmentSizeFactor)
|
||||
return getSegmentCapacityPolicy(Params.SegmentSealProportion)
|
||||
}
|
||||
|
||||
func defaultFlushPolicy() flushPolicy {
|
||||
|
@ -287,7 +287,7 @@ func (s *SegmentManager) genExpireTs() (Timestamp, error) {
|
|||
return 0, err
|
||||
}
|
||||
physicalTs, logicalTs := tsoutil.ParseTS(ts)
|
||||
expirePhysicalTs := physicalTs.Add(time.Duration(Params.SegIDAssignExpiration) * time.Millisecond)
|
||||
expirePhysicalTs := physicalTs.Add(time.Duration(Params.SegAssignmentExpiration) * time.Millisecond)
|
||||
expireTs := tsoutil.ComposeTS(expirePhysicalTs.UnixNano()/int64(time.Millisecond), int64(logicalTs))
|
||||
return expireTs, nil
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ func TestAssignSegmentID(t *testing.T) {
|
|||
})
|
||||
recordSize, err := typeutil.EstimateSizePerRecord(schema)
|
||||
assert.Nil(t, err)
|
||||
maxCount := int(Params.SegmentSize * 1024 * 1024 / float64(recordSize))
|
||||
maxCount := int(Params.SegmentMaxSize * 1024 * 1024 / float64(recordSize))
|
||||
|
||||
cases := []struct {
|
||||
Description string
|
||||
|
|
Loading…
Reference in New Issue