enhance: remove fallback keys for config generator (#32946)

Signed-off-by: sunby <sunbingyi1992@gmail.com>
pull/33008/head
Bingyi Sun 2024-05-13 13:33:31 +08:00 committed by GitHub
parent 230c88b1de
commit 4724779b3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 27 additions and 38 deletions

View File

@ -70,11 +70,6 @@ func collectRecursive(params *paramtable.ComponentParam, data *[]DocContent, val
defaultValue := params.GetWithDefault(item.Key, item.DefaultValue)
log.Debug("got key", zap.String("key", item.Key), zap.Any("value", defaultValue), zap.String("variable", val.Type().Field(j).Name))
*data = append(*data, DocContent{item.Key, defaultValue, item.Version, refreshable, item.Export, item.Doc})
for _, fk := range item.FallbackKeys {
defaultValue = params.GetWithDefault(fk, item.DefaultValue)
log.Debug("got fallback key", zap.String("key", fk), zap.Any("value", defaultValue), zap.String("variable", val.Type().Field(j).Name))
*data = append(*data, DocContent{fk, defaultValue, item.Version, refreshable, item.Export, item.Doc})
}
} else if t == "paramtable.ParamGroup" {
item := subVal.Interface().(paramtable.ParamGroup)
log.Debug("got key", zap.String("key", item.KeyPrefix), zap.String("variable", val.Type().Field(j).Name))

View File

@ -68,7 +68,7 @@ tikv:
tlsCACert: # path to your CACert file
localStorage:
path: /var/lib/milvus/data/ # please adjust in embedded Milvus: /tmp/milvus/data/
path: /tmp/milvus/data/ # please adjust in embedded Milvus: /tmp/milvus/data/
# Related configuration of MinIO/S3/GCS or any other service supports S3 API, which is responsible for data persistence for Milvus.
# We refer to the storage service as MinIO/S3 in the following description for simplicity.
@ -199,7 +199,6 @@ rootCoord:
proxy:
timeTickInterval: 200 # ms, the interval that proxy synchronize the time tick
healthCheckTimeout: 3000 # ms, the interval that to do component healthy check
healthCheckTimetout: 3000 # ms, the interval that to do component healthy check
msgStream:
timeTick:
bufSize: 512
@ -336,11 +335,13 @@ queryNode:
warmup: async
mmap:
mmapEnabled: false # Enable mmap for loading data
mmapEnabled: false # Enable mmap for loading data
lazyloadEnabled: false # Enable lazyload for loading data
lazyloadWaitTimeout: 30000 # max wait timeout duration in milliseconds before start to do lazyload search and retrieve
lazyLoadRequestResourceTimeout: 5000 # max timeout in milliseconds for waiting request resource for lazy load, 5s by default
lazyLoadRequestResourceRetryInterval: 2000 # retry interval in milliseconds for waiting request resource for lazy load, 2s by default
lazyload:
enabled: false # Enable lazyload for loading data
waitTimeout: 30000 # max wait timeout duration in milliseconds before start to do lazyload search and retrieve
requestResourceTimeout: 5000 # max timeout in milliseconds for waiting request resource for lazy load, 5s by default
requestResourceRetryInterval: 2000 # retry interval in milliseconds for waiting request resource for lazy load, 2s by default
maxRetryTimes: 1 # max retry times for lazy load, 1 by default
maxEvictPerRetry: 1 # max evict count for lazy load, 1 by default
grouping:
enabled: true
maxNQ: 1000
@ -541,8 +542,6 @@ log:
grpc:
log:
level: WARNING
serverMaxSendSize: 536870912
serverMaxRecvSize: 268435456
gracefulStopTimeout: 10 # second, time to wait graceful stop finish
client:
compressionEnabled: false
@ -555,8 +554,6 @@ grpc:
minResetInterval: 1000
maxCancelError: 32
minSessionCheckInterval: 200
clientMaxSendSize: 268435456
clientMaxRecvSize: 536870912
# Configure the proxy tls enable.
tls:
@ -565,18 +562,6 @@ tls:
caPemPath: configs/cert/ca.pem
common:
chanNamePrefix:
cluster: by-dev
rootCoordTimeTick: rootcoord-timetick
rootCoordStatistics: rootcoord-statistics
rootCoordDml: rootcoord-dml
replicateMsg: replicate-msg
queryTimeTick: queryTimeTick
dataCoordTimeTick: datacoord-timetick-channel
dataCoordSegmentInfo: segment-info-channel
subNamePrefix:
dataCoordSubNamePrefix: dataCoord
dataNodeSubNamePrefix: dataNode
defaultPartitionName: _default # default partition name for a collection
defaultIndexName: _default_idx # default index name
entityExpiration: -1 # Entity expiration in seconds, CAUTION -1 means never expire

View File

@ -273,6 +273,7 @@ func (p *commonConfig) init(base *BaseTable) {
// --- rootcoord ---
p.RootCoordTimeTick = ParamItem{
Key: "msgChannel.chanNamePrefix.rootCoordTimeTick",
DefaultValue: "rootcoord-timetick",
Version: "2.1.0",
FallbackKeys: []string{"common.chanNamePrefix.rootCoordTimeTick"},
PanicIfEmpty: true,
@ -283,6 +284,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.RootCoordStatistics = ParamItem{
Key: "msgChannel.chanNamePrefix.rootCoordStatistics",
DefaultValue: "rootcoord-statistics",
Version: "2.1.0",
FallbackKeys: []string{"common.chanNamePrefix.rootCoordStatistics"},
PanicIfEmpty: true,
@ -293,6 +295,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.RootCoordDml = ParamItem{
Key: "msgChannel.chanNamePrefix.rootCoordDml",
DefaultValue: "rootcoord-dml",
Version: "2.1.0",
FallbackKeys: []string{"common.chanNamePrefix.rootCoordDml"},
PanicIfEmpty: true,
@ -303,6 +306,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.ReplicateMsgChannel = ParamItem{
Key: "msgChannel.chanNamePrefix.replicateMsg",
DefaultValue: "replicate-msg",
Version: "2.3.2",
FallbackKeys: []string{"common.chanNamePrefix.replicateMsg"},
PanicIfEmpty: true,
@ -313,6 +317,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.QueryCoordTimeTick = ParamItem{
Key: "msgChannel.chanNamePrefix.queryTimeTick",
DefaultValue: "queryTimeTick",
Version: "2.1.0",
FallbackKeys: []string{"common.chanNamePrefix.queryTimeTick"},
PanicIfEmpty: true,
@ -323,6 +328,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.DataCoordTimeTick = ParamItem{
Key: "msgChannel.chanNamePrefix.dataCoordTimeTick",
DefaultValue: "datacoord-timetick-channel",
Version: "2.1.0",
FallbackKeys: []string{"common.chanNamePrefix.dataCoordTimeTick"},
PanicIfEmpty: true,
@ -333,6 +339,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.DataCoordSegmentInfo = ParamItem{
Key: "msgChannel.chanNamePrefix.dataCoordSegmentInfo",
DefaultValue: "segment-info-channel",
Version: "2.1.0",
FallbackKeys: []string{"common.chanNamePrefix.dataCoordSegmentInfo"},
PanicIfEmpty: true,
@ -343,6 +350,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.DataCoordSubName = ParamItem{
Key: "msgChannel.subNamePrefix.dataCoordSubNamePrefix",
DefaultValue: "dataCoord",
Version: "2.1.0",
FallbackKeys: []string{"common.subNamePrefix.dataCoordSubNamePrefix"},
PanicIfEmpty: true,
@ -369,6 +377,7 @@ func (p *commonConfig) init(base *BaseTable) {
p.DataNodeSubName = ParamItem{
Key: "msgChannel.subNamePrefix.dataNodeSubNamePrefix",
DefaultValue: "dataNode",
Version: "2.1.0",
FallbackKeys: []string{"common.subNamePrefix.dataNodeSubNamePrefix"},
PanicIfEmpty: true,
@ -2255,7 +2264,7 @@ func (p *queryNodeConfig) init(base *BaseTable) {
p.MmapEnabled.Init(base.mgr)
p.LazyLoadEnabled = ParamItem{
Key: "queryNode.lazyloadEnabled",
Key: "queryNode.lazyload.enabled",
Version: "2.4.2",
DefaultValue: "false",
Doc: "Enable lazyload for loading data",
@ -2263,7 +2272,7 @@ func (p *queryNodeConfig) init(base *BaseTable) {
}
p.LazyLoadEnabled.Init(base.mgr)
p.LazyLoadWaitTimeout = ParamItem{
Key: "queryNode.lazyloadWaitTimeout",
Key: "queryNode.lazyload.waitTimeout",
Version: "2.4.2",
DefaultValue: "30000",
Doc: "max wait timeout duration in milliseconds before start to do lazyload search and retrieve",
@ -2271,7 +2280,7 @@ func (p *queryNodeConfig) init(base *BaseTable) {
}
p.LazyLoadWaitTimeout.Init(base.mgr)
p.LazyLoadRequestResourceTimeout = ParamItem{
Key: "queryNode.lazyLoadRequestResourceTimeout",
Key: "queryNode.lazyload.requestResourceTimeout",
Version: "2.4.2",
DefaultValue: "5000",
Doc: "max timeout in milliseconds for waiting request resource for lazy load, 5s by default",
@ -2279,7 +2288,7 @@ func (p *queryNodeConfig) init(base *BaseTable) {
}
p.LazyLoadRequestResourceTimeout.Init(base.mgr)
p.LazyLoadRequestResourceRetryInterval = ParamItem{
Key: "queryNode.lazyLoadRequestResourceRetryInterval",
Key: "queryNode.lazyload.requestResourceRetryInterval",
Version: "2.4.2",
DefaultValue: "2000",
Doc: "retry interval in milliseconds for waiting request resource for lazy load, 2s by default",
@ -2288,7 +2297,7 @@ func (p *queryNodeConfig) init(base *BaseTable) {
p.LazyLoadRequestResourceRetryInterval.Init(base.mgr)
p.LazyLoadMaxRetryTimes = ParamItem{
Key: "queryNode.lazyLoadMaxRetryTimes",
Key: "queryNode.lazyload.maxRetryTimes",
Version: "2.4.2",
DefaultValue: "1",
Doc: "max retry times for lazy load, 1 by default",
@ -2297,7 +2306,7 @@ func (p *queryNodeConfig) init(base *BaseTable) {
p.LazyLoadMaxRetryTimes.Init(base.mgr)
p.LazyLoadMaxEvictPerRetry = ParamItem{
Key: "queryNode.lazyLoadMaxEvictPerRetry",
Key: "queryNode.lazyload.maxEvictPerRetry",
Version: "2.4.2",
DefaultValue: "1",
Doc: "max evict count for lazy load, 1 by default",

View File

@ -387,19 +387,19 @@ func TestComponentParam(t *testing.T) {
assert.Equal(t, int64(70*1024*1024), Params.DiskCacheCapacityLimit.GetAsSize())
assert.False(t, Params.LazyLoadEnabled.GetAsBool())
params.Save("queryNode.lazyloadEnabled", "true")
params.Save("queryNode.lazyload.enabled", "true")
assert.True(t, Params.LazyLoadEnabled.GetAsBool())
assert.Equal(t, 30*time.Second, Params.LazyLoadWaitTimeout.GetAsDuration(time.Millisecond))
params.Save("queryNode.lazyloadWaitTimeout", "100")
params.Save("queryNode.lazyload.waitTimeout", "100")
assert.Equal(t, 100*time.Millisecond, Params.LazyLoadWaitTimeout.GetAsDuration(time.Millisecond))
assert.Equal(t, 5*time.Second, Params.LazyLoadRequestResourceTimeout.GetAsDuration(time.Millisecond))
params.Save("queryNode.lazyLoadRequestResourceTimeout", "100")
params.Save("queryNode.lazyload.requestResourceTimeout", "100")
assert.Equal(t, 100*time.Millisecond, Params.LazyLoadRequestResourceTimeout.GetAsDuration(time.Millisecond))
assert.Equal(t, 2*time.Second, Params.LazyLoadRequestResourceRetryInterval.GetAsDuration(time.Millisecond))
params.Save("queryNode.lazyLoadRequestResourceRetryInterval", "3000")
params.Save("queryNode.lazyload.requestResourceRetryInterval", "3000")
assert.Equal(t, 3*time.Second, Params.LazyLoadRequestResourceRetryInterval.GetAsDuration(time.Millisecond))
})