diff --git a/internal/util/paramtable/component_param.go b/internal/util/paramtable/component_param.go index 72417d5cf0..6724d8da74 100644 --- a/internal/util/paramtable/component_param.go +++ b/internal/util/paramtable/component_param.go @@ -212,10 +212,10 @@ type commonConfig struct { func (p *commonConfig) init(base *BaseTable) { // must init cluster prefix first p.ClusterPrefix = ParamItem{ - Key: "common.chanNamePrefix.cluster", + Key: "msgChannel.chanNamePrefix.cluster", Version: "2.1.0", + FallbackKeys: []string{"common.chanNamePrefix.cluster"}, DefaultValue: "by-dev", - FallbackKeys: []string{"msgChannel.chanNamePrefix.cluster"}, PanicIfEmpty: true, Forbidden: true, Export: true, @@ -226,9 +226,9 @@ func (p *commonConfig) init(base *BaseTable) { return strings.Join([]string{p.ClusterPrefix.GetValue(), prefix}, "-") } p.ProxySubName = ParamItem{ - Key: "common.subNamePrefix.proxySubNamePrefix", + Key: "msgChannel.subNamePrefix.proxySubNamePrefix", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.subNamePrefix.proxySubNamePrefix"}, + FallbackKeys: []string{"common.subNamePrefix.proxySubNamePrefix"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -237,9 +237,9 @@ func (p *commonConfig) init(base *BaseTable) { // --- rootcoord --- p.RootCoordTimeTick = ParamItem{ - Key: "common.chanNamePrefix.rootCoordTimeTick", + Key: "msgChannel.chanNamePrefix.rootCoordTimeTick", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.rootCoordTimeTick"}, + FallbackKeys: []string{"common.chanNamePrefix.rootCoordTimeTick"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -247,9 +247,9 @@ func (p *commonConfig) init(base *BaseTable) { p.RootCoordTimeTick.Init(base.mgr) p.RootCoordStatistics = ParamItem{ - Key: "common.chanNamePrefix.rootCoordStatistics", + Key: "msgChannel.chanNamePrefix.rootCoordStatistics", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.rootCoordStatistics"}, + FallbackKeys: []string{"common.chanNamePrefix.rootCoordStatistics"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -257,9 +257,9 @@ func (p *commonConfig) init(base *BaseTable) { p.RootCoordStatistics.Init(base.mgr) p.RootCoordDml = ParamItem{ - Key: "common.chanNamePrefix.rootCoordDml", + Key: "msgChannel.chanNamePrefix.rootCoordDml", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.rootCoordDml"}, + FallbackKeys: []string{"common.chanNamePrefix.rootCoordDml"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -267,9 +267,9 @@ func (p *commonConfig) init(base *BaseTable) { p.RootCoordDml.Init(base.mgr) p.RootCoordDelta = ParamItem{ - Key: "common.chanNamePrefix.rootCoordDelta", + Key: "msgChannel.chanNamePrefix.rootCoordDelta", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.rootCoordDelta"}, + FallbackKeys: []string{"common.chanNamePrefix.rootCoordDelta"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -277,9 +277,9 @@ func (p *commonConfig) init(base *BaseTable) { p.RootCoordDelta.Init(base.mgr) p.RootCoordSubName = ParamItem{ - Key: "common.subNamePrefix.rootCoordSubNamePrefix", + Key: "msgChannel.subNamePrefix.rootCoordSubNamePrefix", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.subNamePrefix.rootCoordSubNamePrefix"}, + FallbackKeys: []string{"common.subNamePrefix.rootCoordSubNamePrefix"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -287,9 +287,9 @@ func (p *commonConfig) init(base *BaseTable) { p.RootCoordSubName.Init(base.mgr) p.QueryCoordSearch = ParamItem{ - Key: "common.chanNamePrefix.search", + Key: "msgChannel.chanNamePrefix.search", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.search"}, + FallbackKeys: []string{"common.chanNamePrefix.search"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -297,9 +297,9 @@ func (p *commonConfig) init(base *BaseTable) { p.QueryCoordSearch.Init(base.mgr) p.QueryCoordSearchResult = ParamItem{ - Key: "common.chanNamePrefix.searchResult", + Key: "msgChannel.chanNamePrefix.searchResult", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.searchResult"}, + FallbackKeys: []string{"common.chanNamePrefix.searchResult"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -307,9 +307,9 @@ func (p *commonConfig) init(base *BaseTable) { p.QueryCoordSearchResult.Init(base.mgr) p.QueryCoordTimeTick = ParamItem{ - Key: "common.chanNamePrefix.queryTimeTick", + Key: "msgChannel.chanNamePrefix.queryTimeTick", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.queryTimeTick"}, + FallbackKeys: []string{"common.chanNamePrefix.queryTimeTick"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -317,9 +317,9 @@ func (p *commonConfig) init(base *BaseTable) { p.QueryCoordTimeTick.Init(base.mgr) p.QueryNodeSubName = ParamItem{ - Key: "common.subNamePrefix.queryNodeSubNamePrefix", + Key: "msgChannel.subNamePrefix.queryNodeSubNamePrefix", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.subNamePrefix.queryNodeSubNamePrefix"}, + FallbackKeys: []string{"common.subNamePrefix.queryNodeSubNamePrefix"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -327,9 +327,9 @@ func (p *commonConfig) init(base *BaseTable) { p.QueryNodeSubName.Init(base.mgr) p.DataCoordStatistic = ParamItem{ - Key: "common.chanNamePrefix.dataCoordStatistic", + Key: "msgChannel.chanNamePrefix.dataCoordStatistic", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.dataCoordStatistic"}, + FallbackKeys: []string{"common.chanNamePrefix.dataCoordStatistic"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -337,9 +337,9 @@ func (p *commonConfig) init(base *BaseTable) { p.DataCoordStatistic.Init(base.mgr) p.DataCoordTimeTick = ParamItem{ - Key: "common.chanNamePrefix.dataCoordTimeTick", + Key: "msgChannel.chanNamePrefix.dataCoordTimeTick", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.dataCoordTimeTick"}, + FallbackKeys: []string{"common.chanNamePrefix.dataCoordTimeTick"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -347,9 +347,9 @@ func (p *commonConfig) init(base *BaseTable) { p.DataCoordTimeTick.Init(base.mgr) p.DataCoordSegmentInfo = ParamItem{ - Key: "common.chanNamePrefix.dataCoordSegmentInfo", + Key: "msgChannel.chanNamePrefix.dataCoordSegmentInfo", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.chanNamePrefix.dataCoordSegmentInfo"}, + FallbackKeys: []string{"common.chanNamePrefix.dataCoordSegmentInfo"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -357,9 +357,9 @@ func (p *commonConfig) init(base *BaseTable) { p.DataCoordSegmentInfo.Init(base.mgr) p.DataCoordSubName = ParamItem{ - Key: "common.subNamePrefix.dataCoordSubNamePrefix", + Key: "msgChannel.subNamePrefix.dataCoordSubNamePrefix", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.subNamePrefix.dataCoordSubNamePrefix"}, + FallbackKeys: []string{"common.subNamePrefix.dataCoordSubNamePrefix"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -383,9 +383,9 @@ func (p *commonConfig) init(base *BaseTable) { p.DataCoordTicklePath.Init(base.mgr) p.DataNodeSubName = ParamItem{ - Key: "common.subNamePrefix.dataNodeSubNamePrefix", + Key: "msgChannel.subNamePrefix.dataNodeSubNamePrefix", Version: "2.1.0", - FallbackKeys: []string{"msgChannel.subNamePrefix.dataNodeSubNamePrefix"}, + FallbackKeys: []string{"common.subNamePrefix.dataNodeSubNamePrefix"}, PanicIfEmpty: true, Formatter: chanNamePrefix, Export: true, @@ -747,6 +747,7 @@ func (p *rootCoordConfig) init(base *BaseTable) { Key: "rootCoord.dmlChannelNum", Version: "2.0.0", DefaultValue: "256", + Forbidden: true, Doc: "The number of dml channels created at system startup", Export: true, } diff --git a/internal/util/paramtable/component_param_test.go b/internal/util/paramtable/component_param_test.go index ddb185158c..bdc328affa 100644 --- a/internal/util/paramtable/component_param_test.go +++ b/internal/util/paramtable/component_param_test.go @@ -354,6 +354,13 @@ func TestComponentParam(t *testing.T) { assert.Equal(t, Params.GracefulStopTimeout.GetAsInt64(), int64(50)) }) + t.Run("channel config priority", func(t *testing.T) { + Params := params.CommonCfg + params.Save(Params.RootCoordDml.Key, "dml1") + params.Save(Params.RootCoordDml.FallbackKeys[0], "dml2") + + assert.Equal(t, "by-dev-dml1", Params.RootCoordDml.GetValue()) + }) } func TestForbiddenItem(t *testing.T) {