Skip to content

Commit 4724779

Browse files
authored
enhance: remove fallback keys for config generator (milvus-io#32946)
Signed-off-by: sunby <sunbingyi1992@gmail.com>
1 parent 230c88b commit 4724779

4 files changed

Lines changed: 27 additions & 38 deletions

File tree

cmd/tools/config/generate.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ func collectRecursive(params *paramtable.ComponentParam, data *[]DocContent, val
7070
defaultValue := params.GetWithDefault(item.Key, item.DefaultValue)
7171
log.Debug("got key", zap.String("key", item.Key), zap.Any("value", defaultValue), zap.String("variable", val.Type().Field(j).Name))
7272
*data = append(*data, DocContent{item.Key, defaultValue, item.Version, refreshable, item.Export, item.Doc})
73-
for _, fk := range item.FallbackKeys {
74-
defaultValue = params.GetWithDefault(fk, item.DefaultValue)
75-
log.Debug("got fallback key", zap.String("key", fk), zap.Any("value", defaultValue), zap.String("variable", val.Type().Field(j).Name))
76-
*data = append(*data, DocContent{fk, defaultValue, item.Version, refreshable, item.Export, item.Doc})
77-
}
7873
} else if t == "paramtable.ParamGroup" {
7974
item := subVal.Interface().(paramtable.ParamGroup)
8075
log.Debug("got key", zap.String("key", item.KeyPrefix), zap.String("variable", val.Type().Field(j).Name))

configs/milvus.yaml

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ tikv:
6868
tlsCACert: # path to your CACert file
6969

7070
localStorage:
71-
path: /var/lib/milvus/data/ # please adjust in embedded Milvus: /tmp/milvus/data/
71+
path: /tmp/milvus/data/ # please adjust in embedded Milvus: /tmp/milvus/data/
7272

7373
# Related configuration of MinIO/S3/GCS or any other service supports S3 API, which is responsible for data persistence for Milvus.
7474
# We refer to the storage service as MinIO/S3 in the following description for simplicity.
@@ -199,7 +199,6 @@ rootCoord:
199199
proxy:
200200
timeTickInterval: 200 # ms, the interval that proxy synchronize the time tick
201201
healthCheckTimeout: 3000 # ms, the interval that to do component healthy check
202-
healthCheckTimetout: 3000 # ms, the interval that to do component healthy check
203202
msgStream:
204203
timeTick:
205204
bufSize: 512
@@ -336,11 +335,13 @@ queryNode:
336335
warmup: async
337336
mmap:
338337
mmapEnabled: false # Enable mmap for loading data
339-
mmapEnabled: false # Enable mmap for loading data
340-
lazyloadEnabled: false # Enable lazyload for loading data
341-
lazyloadWaitTimeout: 30000 # max wait timeout duration in milliseconds before start to do lazyload search and retrieve
342-
lazyLoadRequestResourceTimeout: 5000 # max timeout in milliseconds for waiting request resource for lazy load, 5s by default
343-
lazyLoadRequestResourceRetryInterval: 2000 # retry interval in milliseconds for waiting request resource for lazy load, 2s by default
338+
lazyload:
339+
enabled: false # Enable lazyload for loading data
340+
waitTimeout: 30000 # max wait timeout duration in milliseconds before start to do lazyload search and retrieve
341+
requestResourceTimeout: 5000 # max timeout in milliseconds for waiting request resource for lazy load, 5s by default
342+
requestResourceRetryInterval: 2000 # retry interval in milliseconds for waiting request resource for lazy load, 2s by default
343+
maxRetryTimes: 1 # max retry times for lazy load, 1 by default
344+
maxEvictPerRetry: 1 # max evict count for lazy load, 1 by default
344345
grouping:
345346
enabled: true
346347
maxNQ: 1000
@@ -541,8 +542,6 @@ log:
541542
grpc:
542543
log:
543544
level: WARNING
544-
serverMaxSendSize: 536870912
545-
serverMaxRecvSize: 268435456
546545
gracefulStopTimeout: 10 # second, time to wait graceful stop finish
547546
client:
548547
compressionEnabled: false
@@ -555,8 +554,6 @@ grpc:
555554
minResetInterval: 1000
556555
maxCancelError: 32
557556
minSessionCheckInterval: 200
558-
clientMaxSendSize: 268435456
559-
clientMaxRecvSize: 536870912
560557

561558
# Configure the proxy tls enable.
562559
tls:
@@ -565,18 +562,6 @@ tls:
565562
caPemPath: configs/cert/ca.pem
566563

567564
common:
568-
chanNamePrefix:
569-
cluster: by-dev
570-
rootCoordTimeTick: rootcoord-timetick
571-
rootCoordStatistics: rootcoord-statistics
572-
rootCoordDml: rootcoord-dml
573-
replicateMsg: replicate-msg
574-
queryTimeTick: queryTimeTick
575-
dataCoordTimeTick: datacoord-timetick-channel
576-
dataCoordSegmentInfo: segment-info-channel
577-
subNamePrefix:
578-
dataCoordSubNamePrefix: dataCoord
579-
dataNodeSubNamePrefix: dataNode
580565
defaultPartitionName: _default # default partition name for a collection
581566
defaultIndexName: _default_idx # default index name
582567
entityExpiration: -1 # Entity expiration in seconds, CAUTION -1 means never expire

pkg/util/paramtable/component_param.go

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ func (p *commonConfig) init(base *BaseTable) {
273273
// --- rootcoord ---
274274
p.RootCoordTimeTick = ParamItem{
275275
Key: "msgChannel.chanNamePrefix.rootCoordTimeTick",
276+
DefaultValue: "rootcoord-timetick",
276277
Version: "2.1.0",
277278
FallbackKeys: []string{"common.chanNamePrefix.rootCoordTimeTick"},
278279
PanicIfEmpty: true,
@@ -283,6 +284,7 @@ func (p *commonConfig) init(base *BaseTable) {
283284

284285
p.RootCoordStatistics = ParamItem{
285286
Key: "msgChannel.chanNamePrefix.rootCoordStatistics",
287+
DefaultValue: "rootcoord-statistics",
286288
Version: "2.1.0",
287289
FallbackKeys: []string{"common.chanNamePrefix.rootCoordStatistics"},
288290
PanicIfEmpty: true,
@@ -293,6 +295,7 @@ func (p *commonConfig) init(base *BaseTable) {
293295

294296
p.RootCoordDml = ParamItem{
295297
Key: "msgChannel.chanNamePrefix.rootCoordDml",
298+
DefaultValue: "rootcoord-dml",
296299
Version: "2.1.0",
297300
FallbackKeys: []string{"common.chanNamePrefix.rootCoordDml"},
298301
PanicIfEmpty: true,
@@ -303,6 +306,7 @@ func (p *commonConfig) init(base *BaseTable) {
303306

304307
p.ReplicateMsgChannel = ParamItem{
305308
Key: "msgChannel.chanNamePrefix.replicateMsg",
309+
DefaultValue: "replicate-msg",
306310
Version: "2.3.2",
307311
FallbackKeys: []string{"common.chanNamePrefix.replicateMsg"},
308312
PanicIfEmpty: true,
@@ -313,6 +317,7 @@ func (p *commonConfig) init(base *BaseTable) {
313317

314318
p.QueryCoordTimeTick = ParamItem{
315319
Key: "msgChannel.chanNamePrefix.queryTimeTick",
320+
DefaultValue: "queryTimeTick",
316321
Version: "2.1.0",
317322
FallbackKeys: []string{"common.chanNamePrefix.queryTimeTick"},
318323
PanicIfEmpty: true,
@@ -323,6 +328,7 @@ func (p *commonConfig) init(base *BaseTable) {
323328

324329
p.DataCoordTimeTick = ParamItem{
325330
Key: "msgChannel.chanNamePrefix.dataCoordTimeTick",
331+
DefaultValue: "datacoord-timetick-channel",
326332
Version: "2.1.0",
327333
FallbackKeys: []string{"common.chanNamePrefix.dataCoordTimeTick"},
328334
PanicIfEmpty: true,
@@ -333,6 +339,7 @@ func (p *commonConfig) init(base *BaseTable) {
333339

334340
p.DataCoordSegmentInfo = ParamItem{
335341
Key: "msgChannel.chanNamePrefix.dataCoordSegmentInfo",
342+
DefaultValue: "segment-info-channel",
336343
Version: "2.1.0",
337344
FallbackKeys: []string{"common.chanNamePrefix.dataCoordSegmentInfo"},
338345
PanicIfEmpty: true,
@@ -343,6 +350,7 @@ func (p *commonConfig) init(base *BaseTable) {
343350

344351
p.DataCoordSubName = ParamItem{
345352
Key: "msgChannel.subNamePrefix.dataCoordSubNamePrefix",
353+
DefaultValue: "dataCoord",
346354
Version: "2.1.0",
347355
FallbackKeys: []string{"common.subNamePrefix.dataCoordSubNamePrefix"},
348356
PanicIfEmpty: true,
@@ -369,6 +377,7 @@ func (p *commonConfig) init(base *BaseTable) {
369377

370378
p.DataNodeSubName = ParamItem{
371379
Key: "msgChannel.subNamePrefix.dataNodeSubNamePrefix",
380+
DefaultValue: "dataNode",
372381
Version: "2.1.0",
373382
FallbackKeys: []string{"common.subNamePrefix.dataNodeSubNamePrefix"},
374383
PanicIfEmpty: true,
@@ -2255,31 +2264,31 @@ func (p *queryNodeConfig) init(base *BaseTable) {
22552264
p.MmapEnabled.Init(base.mgr)
22562265

22572266
p.LazyLoadEnabled = ParamItem{
2258-
Key: "queryNode.lazyloadEnabled",
2267+
Key: "queryNode.lazyload.enabled",
22592268
Version: "2.4.2",
22602269
DefaultValue: "false",
22612270
Doc: "Enable lazyload for loading data",
22622271
Export: true,
22632272
}
22642273
p.LazyLoadEnabled.Init(base.mgr)
22652274
p.LazyLoadWaitTimeout = ParamItem{
2266-
Key: "queryNode.lazyloadWaitTimeout",
2275+
Key: "queryNode.lazyload.waitTimeout",
22672276
Version: "2.4.2",
22682277
DefaultValue: "30000",
22692278
Doc: "max wait timeout duration in milliseconds before start to do lazyload search and retrieve",
22702279
Export: true,
22712280
}
22722281
p.LazyLoadWaitTimeout.Init(base.mgr)
22732282
p.LazyLoadRequestResourceTimeout = ParamItem{
2274-
Key: "queryNode.lazyLoadRequestResourceTimeout",
2283+
Key: "queryNode.lazyload.requestResourceTimeout",
22752284
Version: "2.4.2",
22762285
DefaultValue: "5000",
22772286
Doc: "max timeout in milliseconds for waiting request resource for lazy load, 5s by default",
22782287
Export: true,
22792288
}
22802289
p.LazyLoadRequestResourceTimeout.Init(base.mgr)
22812290
p.LazyLoadRequestResourceRetryInterval = ParamItem{
2282-
Key: "queryNode.lazyLoadRequestResourceRetryInterval",
2291+
Key: "queryNode.lazyload.requestResourceRetryInterval",
22832292
Version: "2.4.2",
22842293
DefaultValue: "2000",
22852294
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) {
22882297
p.LazyLoadRequestResourceRetryInterval.Init(base.mgr)
22892298

22902299
p.LazyLoadMaxRetryTimes = ParamItem{
2291-
Key: "queryNode.lazyLoadMaxRetryTimes",
2300+
Key: "queryNode.lazyload.maxRetryTimes",
22922301
Version: "2.4.2",
22932302
DefaultValue: "1",
22942303
Doc: "max retry times for lazy load, 1 by default",
@@ -2297,7 +2306,7 @@ func (p *queryNodeConfig) init(base *BaseTable) {
22972306
p.LazyLoadMaxRetryTimes.Init(base.mgr)
22982307

22992308
p.LazyLoadMaxEvictPerRetry = ParamItem{
2300-
Key: "queryNode.lazyLoadMaxEvictPerRetry",
2309+
Key: "queryNode.lazyload.maxEvictPerRetry",
23012310
Version: "2.4.2",
23022311
DefaultValue: "1",
23032312
Doc: "max evict count for lazy load, 1 by default",

pkg/util/paramtable/component_param_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,19 +387,19 @@ func TestComponentParam(t *testing.T) {
387387
assert.Equal(t, int64(70*1024*1024), Params.DiskCacheCapacityLimit.GetAsSize())
388388

389389
assert.False(t, Params.LazyLoadEnabled.GetAsBool())
390-
params.Save("queryNode.lazyloadEnabled", "true")
390+
params.Save("queryNode.lazyload.enabled", "true")
391391
assert.True(t, Params.LazyLoadEnabled.GetAsBool())
392392

393393
assert.Equal(t, 30*time.Second, Params.LazyLoadWaitTimeout.GetAsDuration(time.Millisecond))
394-
params.Save("queryNode.lazyloadWaitTimeout", "100")
394+
params.Save("queryNode.lazyload.waitTimeout", "100")
395395
assert.Equal(t, 100*time.Millisecond, Params.LazyLoadWaitTimeout.GetAsDuration(time.Millisecond))
396396

397397
assert.Equal(t, 5*time.Second, Params.LazyLoadRequestResourceTimeout.GetAsDuration(time.Millisecond))
398-
params.Save("queryNode.lazyLoadRequestResourceTimeout", "100")
398+
params.Save("queryNode.lazyload.requestResourceTimeout", "100")
399399
assert.Equal(t, 100*time.Millisecond, Params.LazyLoadRequestResourceTimeout.GetAsDuration(time.Millisecond))
400400

401401
assert.Equal(t, 2*time.Second, Params.LazyLoadRequestResourceRetryInterval.GetAsDuration(time.Millisecond))
402-
params.Save("queryNode.lazyLoadRequestResourceRetryInterval", "3000")
402+
params.Save("queryNode.lazyload.requestResourceRetryInterval", "3000")
403403
assert.Equal(t, 3*time.Second, Params.LazyLoadRequestResourceRetryInterval.GetAsDuration(time.Millisecond))
404404
})
405405

0 commit comments

Comments
 (0)