Add compaction worker max parallel config item (#25834)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/25855/head
congqixia 2023-07-24 10:17:00 +08:00 committed by GitHub
parent d92aac951a
commit 37636b2f4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -431,7 +431,8 @@ func setResult(result *datapb.CompactionResult) compactionTaskOpt {
// 0.5*min(8, NumCPU/2)
func calculateParallel() int {
return 2
// TODO after node memory management enabled, use this config as hard limit
return Params.DataCoordCfg.CompactionWorkerParalleTasks.GetAsInt()
//cores := runtime.NumCPU()
//if cores < 16 {
//return 4

View File

@ -1921,6 +1921,7 @@ type dataCoordConfig struct {
CompactionRPCTimeout ParamItem `refreshable:"true"`
CompactionMaxParallelTasks ParamItem `refreshable:"true"`
CompactionWorkerParalleTasks ParamItem `refreshable:"true"`
MinSegmentToMerge ParamItem `refreshable:"true"`
MaxSegmentToMerge ParamItem `refreshable:"true"`
SegmentSmallProportion ParamItem `refreshable:"true"`
@ -2093,6 +2094,14 @@ the number of binlog file reaches to max value.`,
}
p.CompactionMaxParallelTasks.Init(base.mgr)
p.CompactionWorkerParalleTasks = ParamItem{
Key: "dataCoord.compaction.workerMaxParallelTaskNum",
Version: "2.3.0",
DefaultValue: "2",
Export: true,
}
p.CompactionWorkerParalleTasks.Init(base.mgr)
p.MinSegmentToMerge = ParamItem{
Key: "dataCoord.compaction.min.segment",
Version: "2.0.0",