diff --git a/cmd/roles/roles.go b/cmd/roles/roles.go index b1db0682e1d60..ff0c498c0369f 100644 --- a/cmd/roles/roles.go +++ b/cmd/roles/roles.go @@ -420,10 +420,10 @@ func (mr *MilvusRoles) Run() { action := func(GOGC uint32) { debug.SetGCPercent(int(GOGC)) } - gc.NewTuner(paramtable.Get().CommonCfg.OverloadedMemoryThresholdPercentage.GetAsFloat(), uint32(paramtable.Get().QueryNodeCfg.MinimumGOGCConfig.GetAsInt()), uint32(paramtable.Get().QueryNodeCfg.MaximumGOGCConfig.GetAsInt()), action) + gc.NewTuner(paramtable.Get().CommonCfg.OverloadedMemoryThresholdPercentage.GetAsFloat(), uint32(paramtable.Get().CommonCfg.MinimumGOGCConfig.GetAsInt()), uint32(paramtable.Get().CommonCfg.MaximumGOGCConfig.GetAsInt()), action) } else { action := func(uint32) {} - gc.NewTuner(paramtable.Get().CommonCfg.OverloadedMemoryThresholdPercentage.GetAsFloat(), uint32(paramtable.Get().QueryNodeCfg.MinimumGOGCConfig.GetAsInt()), uint32(paramtable.Get().QueryNodeCfg.MaximumGOGCConfig.GetAsInt()), action) + gc.NewTuner(paramtable.Get().CommonCfg.OverloadedMemoryThresholdPercentage.GetAsFloat(), uint32(paramtable.Get().CommonCfg.MinimumGOGCConfig.GetAsInt()), uint32(paramtable.Get().CommonCfg.MaximumGOGCConfig.GetAsInt()), action) } } diff --git a/internal/querynodev2/handlers_test.go b/internal/querynodev2/handlers_test.go index a9b2ed0f1d8db..a311743fca097 100644 --- a/internal/querynodev2/handlers_test.go +++ b/internal/querynodev2/handlers_test.go @@ -63,7 +63,7 @@ func (suite *HandlersSuite) SetupTest() { var err error paramtable.Init() suite.params = paramtable.Get() - suite.params.Save(suite.params.QueryNodeCfg.GCEnabled.Key, "false") + suite.params.Save(suite.params.CommonCfg.GCEnabled.Key, "false") // mock factory suite.factory = dependency.NewMockFactory(suite.T()) diff --git a/internal/querynodev2/local_worker_test.go b/internal/querynodev2/local_worker_test.go index b916d609100b5..724387e137fcb 100644 --- a/internal/querynodev2/local_worker_test.go +++ b/internal/querynodev2/local_worker_test.go @@ -71,7 +71,7 @@ func (suite *LocalWorkerTestSuite) BeforeTest(suiteName, testName string) { paramtable.Init() suite.params = paramtable.Get() // close GC at test to avoid data race - suite.params.Save(suite.params.QueryNodeCfg.GCEnabled.Key, "false") + suite.params.Save(suite.params.CommonCfg.GCEnabled.Key, "false") suite.ctx, suite.cancel = context.WithCancel(context.Background()) // init node diff --git a/internal/querynodev2/server_test.go b/internal/querynodev2/server_test.go index cc9854a606764..30164e0b8bbd2 100644 --- a/internal/querynodev2/server_test.go +++ b/internal/querynodev2/server_test.go @@ -65,7 +65,7 @@ func (suite *QueryNodeSuite) SetupTest() { var err error paramtable.Init() suite.params = paramtable.Get() - suite.params.Save(suite.params.QueryNodeCfg.GCEnabled.Key, "false") + suite.params.Save(suite.params.CommonCfg.GCEnabled.Key, "false") // mock factory suite.factory = dependency.NewMockFactory(suite.T()) diff --git a/internal/querynodev2/services_test.go b/internal/querynodev2/services_test.go index 8a8225ea0775c..86d88b37320b4 100644 --- a/internal/querynodev2/services_test.go +++ b/internal/querynodev2/services_test.go @@ -94,7 +94,7 @@ func (suite *ServiceSuite) SetupSuite() { // collection and segments data // init param paramtable.Init() - paramtable.Get().Save(paramtable.Get().QueryNodeCfg.GCEnabled.Key, "false") + paramtable.Get().Save(paramtable.Get().CommonCfg.GCEnabled.Key, "false") suite.rootPath = suite.T().Name() suite.collectionID = 111 diff --git a/pkg/util/paramtable/component_param.go b/pkg/util/paramtable/component_param.go index 28ee053737acf..371f242d6785a 100644 --- a/pkg/util/paramtable/component_param.go +++ b/pkg/util/paramtable/component_param.go @@ -265,11 +265,13 @@ type commonConfig struct { UseVectorAsClusteringKey ParamItem `refreshable:"true"` EnableVectorClusteringKey ParamItem `refreshable:"true"` - GCEnabled ParamItem `refreshable:"false"` - GCHelperEnabled ParamItem `refreshable:"false"` + // GC + GCEnabled ParamItem `refreshable:"false"` + GCHelperEnabled ParamItem `refreshable:"false"` + MaximumGOGCConfig ParamItem `refreshable:"false"` + MinimumGOGCConfig ParamItem `refreshable:"false"` + OverloadedMemoryThresholdPercentage ParamItem `refreshable:"false"` - MaximumGOGCConfig ParamItem `refreshable:"false"` - MinimumGOGCConfig ParamItem `refreshable:"false"` ReadOnlyPrivileges ParamItem `refreshable:"false"` ReadWritePrivileges ParamItem `refreshable:"false"` AdminPrivileges ParamItem `refreshable:"false"` @@ -853,6 +855,7 @@ This helps Milvus-CDC synchronize incremental data`, p.GCEnabled = ParamItem{ Key: "common.gcenabled", + FallbackKeys: []string{"queryNode.gcenabled"}, Version: "2.4.7", DefaultValue: "true", } @@ -860,6 +863,7 @@ This helps Milvus-CDC synchronize incremental data`, p.GCHelperEnabled = ParamItem{ Key: "common.gchelper.enabled", + FallbackKeys: []string{"queryNode.gchelper.enabled"}, Version: "2.4.7", DefaultValue: "true", } @@ -878,6 +882,7 @@ This helps Milvus-CDC synchronize incremental data`, p.MaximumGOGCConfig = ParamItem{ Key: "common.gchelper.maximumGoGC", + FallbackKeys: []string{"queryNode.gchelper.maximumGoGC"}, Version: "2.4.7", DefaultValue: "200", } @@ -885,6 +890,7 @@ This helps Milvus-CDC synchronize incremental data`, p.MinimumGOGCConfig = ParamItem{ Key: "common.gchelper.minimumGoGC", + FallbackKeys: []string{"queryNode.gchelper.minimumGoGC"}, Version: "2.4.7", DefaultValue: "30", } @@ -2379,12 +2385,7 @@ type queryNodeConfig struct { TopKMergeRatio ParamItem `refreshable:"true"` CPURatio ParamItem `refreshable:"true"` MaxTimestampLag ParamItem `refreshable:"true"` - GCEnabled ParamItem `refreshable:"true"` - - GCHelperEnabled ParamItem `refreshable:"false"` - MinimumGOGCConfig ParamItem `refreshable:"false"` - MaximumGOGCConfig ParamItem `refreshable:"false"` - GracefulStopTimeout ParamItem `refreshable:"false"` + GracefulStopTimeout ParamItem `refreshable:"false"` // delete buffer MaxSegmentDeleteBuffer ParamItem `refreshable:"false"` @@ -2952,34 +2953,6 @@ Max read concurrency must greater than or equal to 1, and less than or equal to } p.MaxTimestampLag.Init(base.mgr) - p.GCEnabled = ParamItem{ - Key: "queryNode.gcenabled", - Version: "2.3.0", - DefaultValue: "true", - } - p.GCEnabled.Init(base.mgr) - - p.GCHelperEnabled = ParamItem{ - Key: "queryNode.gchelper.enabled", - Version: "2.0.0", - DefaultValue: "true", - } - p.GCHelperEnabled.Init(base.mgr) - - p.MaximumGOGCConfig = ParamItem{ - Key: "queryNode.gchelper.maximumGoGC", - Version: "2.0.0", - DefaultValue: "200", - } - p.MaximumGOGCConfig.Init(base.mgr) - - p.MinimumGOGCConfig = ParamItem{ - Key: "queryNode.gchelper.minimumGoGC", - Version: "2.0.0", - DefaultValue: "30", - } - p.MinimumGOGCConfig.Init(base.mgr) - p.GracefulStopTimeout = ParamItem{ Key: "queryNode.gracefulStopTimeout", Version: "2.2.1",