mirror of https://github.com/milvus-io/milvus.git
enhance: Add param item for datanode l0 batch/linear mode memory ratio (#30523)
See also #27606 --------- Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>pull/30632/head
parent
bb63e324b2
commit
91b02b5d22
|
@ -162,8 +162,8 @@ func (t *levelZeroCompactionTask) compact() (*datapb.CompactionPlanResult, error
|
|||
}
|
||||
|
||||
var resultSegments []*datapb.CompactionSegment
|
||||
// TODO
|
||||
if hardware.GetFreeMemoryCount() < uint64(totalSize)*20 {
|
||||
|
||||
if float64(hardware.GetFreeMemoryCount())*paramtable.Get().DataNodeCfg.L0BatchMemoryRatio.GetAsFloat() < float64(totalSize) {
|
||||
resultSegments, err = t.linearProcess(ctxTimeout, targetSegIDs, totalDeltalogs)
|
||||
} else {
|
||||
resultSegments, err = t.batchProcess(ctxTimeout, targetSegIDs, lo.Values(totalDeltalogs)...)
|
||||
|
|
|
@ -2932,6 +2932,9 @@ type dataNodeConfig struct {
|
|||
UpdateChannelCheckpointRPCTimeout ParamItem `refreshable:"true"`
|
||||
|
||||
MaxConcurrentImportTaskNum ParamItem `refreshable:"true"`
|
||||
|
||||
// Compaction
|
||||
L0BatchMemoryRatio ParamItem `refreshable:"true"`
|
||||
}
|
||||
|
||||
func (p *dataNodeConfig) init(base *BaseTable) {
|
||||
|
@ -3192,6 +3195,15 @@ func (p *dataNodeConfig) init(base *BaseTable) {
|
|||
Export: true,
|
||||
}
|
||||
p.MaxConcurrentImportTaskNum.Init(base.mgr)
|
||||
|
||||
p.L0BatchMemoryRatio = ParamItem{
|
||||
Key: "datanode.compaction.levelZeroBatchMemoryRatio",
|
||||
Version: "2.4.0",
|
||||
Doc: "The minimal memory ratio of free memory for level zero compaction executing in batch mode",
|
||||
DefaultValue: "0.05",
|
||||
Export: true,
|
||||
}
|
||||
p.L0BatchMemoryRatio.Init(base.mgr)
|
||||
}
|
||||
|
||||
// /////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Reference in New Issue