2021-12-17 10:23:15 +08:00
|
|
|
// Copyright (C) 2019-2020 Zilliz. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
|
|
|
|
// with the License. You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
|
|
// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
|
|
// or implied. See the License for the specific language governing permissions and limitations under the License.
|
|
|
|
|
|
|
|
package paramtable
|
|
|
|
|
|
|
|
import (
|
2022-12-07 18:01:19 +08:00
|
|
|
"fmt"
|
2022-05-05 09:49:50 +08:00
|
|
|
"math"
|
2022-08-30 19:50:57 +08:00
|
|
|
"runtime"
|
2021-12-17 10:23:15 +08:00
|
|
|
"strconv"
|
2021-12-23 18:39:11 +08:00
|
|
|
"strings"
|
2021-12-17 10:23:15 +08:00
|
|
|
"sync"
|
2021-12-23 18:39:11 +08:00
|
|
|
"time"
|
2021-12-17 10:23:15 +08:00
|
|
|
|
2023-01-13 15:31:41 +08:00
|
|
|
config "github.com/milvus-io/milvus/internal/config"
|
2022-12-16 15:59:23 +08:00
|
|
|
"github.com/milvus-io/milvus/internal/util/typeutil"
|
2022-10-14 14:19:24 +08:00
|
|
|
"github.com/shirou/gopsutil/v3/disk"
|
2021-12-17 10:23:15 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
2022-10-12 15:17:23 +08:00
|
|
|
// DefaultRetentionDuration defines the default duration for retention which is 1 days in seconds.
|
2023-01-18 13:57:43 +08:00
|
|
|
DefaultRetentionDuration = 0
|
2022-04-08 20:29:33 +08:00
|
|
|
|
|
|
|
// DefaultIndexSliceSize defines the default slice size of index file when serializing.
|
2022-11-03 14:39:40 +08:00
|
|
|
DefaultIndexSliceSize = 16
|
|
|
|
DefaultGracefulTime = 5000 //ms
|
2022-12-06 22:59:19 +08:00
|
|
|
DefaultGracefulStopTimeout = 30 // s
|
2022-11-04 12:41:35 +08:00
|
|
|
DefaultThreadCoreCoefficient = 10
|
2022-09-29 18:35:02 +08:00
|
|
|
|
|
|
|
DefaultSessionTTL = 60 //s
|
|
|
|
DefaultSessionRetryTimes = 30
|
2022-10-14 17:51:24 +08:00
|
|
|
|
|
|
|
DefaultMaxDegree = 56
|
|
|
|
DefaultSearchListSize = 100
|
2022-11-21 16:35:11 +08:00
|
|
|
DefaultPQCodeBudgetGBRatio = 0.125
|
2022-10-14 17:51:24 +08:00
|
|
|
DefaultBuildNumThreadsRatio = 1.0
|
2022-11-21 19:35:11 +08:00
|
|
|
DefaultSearchCacheBudgetGBRatio = 0.10
|
2022-10-14 17:51:24 +08:00
|
|
|
DefaultLoadNumThreadRatio = 8.0
|
|
|
|
DefaultBeamWidthRatio = 4.0
|
2021-12-17 10:23:15 +08:00
|
|
|
)
|
|
|
|
|
2022-02-09 14:41:45 +08:00
|
|
|
// ComponentParam is used to quickly and easily access all components' configurations.
|
2022-02-08 20:57:47 +08:00
|
|
|
type ComponentParam struct {
|
|
|
|
ServiceParam
|
2022-02-07 10:09:45 +08:00
|
|
|
once sync.Once
|
2022-01-10 19:03:35 +08:00
|
|
|
|
2022-10-08 15:38:58 +08:00
|
|
|
CommonCfg commonConfig
|
|
|
|
QuotaConfig quotaConfig
|
|
|
|
AutoIndexConfig autoIndexConfig
|
2023-01-12 16:09:39 +08:00
|
|
|
TraceCfg traceConfig
|
2021-12-23 18:39:11 +08:00
|
|
|
|
|
|
|
RootCoordCfg rootCoordConfig
|
|
|
|
ProxyCfg proxyConfig
|
|
|
|
QueryCoordCfg queryCoordConfig
|
|
|
|
QueryNodeCfg queryNodeConfig
|
|
|
|
DataCoordCfg dataCoordConfig
|
|
|
|
DataNodeCfg dataNodeConfig
|
|
|
|
IndexNodeCfg indexNodeConfig
|
2022-12-16 15:59:23 +08:00
|
|
|
HTTPCfg httpConfig
|
2022-12-07 18:01:19 +08:00
|
|
|
HookCfg hookConfig
|
2022-12-16 15:59:23 +08:00
|
|
|
|
|
|
|
RootCoordGrpcServerCfg GrpcServerConfig
|
|
|
|
ProxyGrpcServerCfg GrpcServerConfig
|
|
|
|
QueryCoordGrpcServerCfg GrpcServerConfig
|
|
|
|
QueryNodeGrpcServerCfg GrpcServerConfig
|
|
|
|
DataCoordGrpcServerCfg GrpcServerConfig
|
|
|
|
DataNodeGrpcServerCfg GrpcServerConfig
|
|
|
|
IndexCoordGrpcServerCfg GrpcServerConfig
|
|
|
|
IndexNodeGrpcServerCfg GrpcServerConfig
|
|
|
|
|
|
|
|
RootCoordGrpcClientCfg GrpcClientConfig
|
|
|
|
ProxyGrpcClientCfg GrpcClientConfig
|
|
|
|
QueryCoordGrpcClientCfg GrpcClientConfig
|
|
|
|
QueryNodeGrpcClientCfg GrpcClientConfig
|
|
|
|
DataCoordGrpcClientCfg GrpcClientConfig
|
|
|
|
DataNodeGrpcClientCfg GrpcClientConfig
|
|
|
|
IndexCoordGrpcClientCfg GrpcClientConfig
|
|
|
|
IndexNodeGrpcClientCfg GrpcClientConfig
|
2023-01-12 19:49:40 +08:00
|
|
|
|
|
|
|
IntegrationTestCfg integrationTestConfig
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
|
|
|
|
2023-01-19 14:53:44 +08:00
|
|
|
// Init initialize once
|
|
|
|
func (p *ComponentParam) Init() {
|
2021-12-23 18:39:11 +08:00
|
|
|
p.once.Do(func() {
|
2023-01-19 14:53:44 +08:00
|
|
|
p.init()
|
2021-12-23 18:39:11 +08:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
2023-01-19 14:53:44 +08:00
|
|
|
// init initialize the global param table
|
|
|
|
|
|
|
|
func (p *ComponentParam) init() {
|
|
|
|
p.ServiceParam.init()
|
2022-01-10 14:51:34 +08:00
|
|
|
|
2022-02-08 20:57:47 +08:00
|
|
|
p.CommonCfg.init(&p.BaseTable)
|
2022-09-16 09:56:47 +08:00
|
|
|
p.QuotaConfig.init(&p.BaseTable)
|
2022-10-08 15:38:58 +08:00
|
|
|
p.AutoIndexConfig.init(&p.BaseTable)
|
2023-01-12 16:09:39 +08:00
|
|
|
p.TraceCfg.init(&p.BaseTable)
|
2022-01-10 17:29:34 +08:00
|
|
|
|
2022-02-08 20:57:47 +08:00
|
|
|
p.RootCoordCfg.init(&p.BaseTable)
|
|
|
|
p.ProxyCfg.init(&p.BaseTable)
|
|
|
|
p.QueryCoordCfg.init(&p.BaseTable)
|
|
|
|
p.QueryNodeCfg.init(&p.BaseTable)
|
|
|
|
p.DataCoordCfg.init(&p.BaseTable)
|
|
|
|
p.DataNodeCfg.init(&p.BaseTable)
|
|
|
|
p.IndexNodeCfg.init(&p.BaseTable)
|
2022-12-16 15:59:23 +08:00
|
|
|
p.HTTPCfg.init(&p.BaseTable)
|
2022-09-23 09:50:52 +08:00
|
|
|
p.HookCfg.init()
|
2022-12-16 15:59:23 +08:00
|
|
|
|
|
|
|
p.RootCoordGrpcServerCfg.Init(typeutil.RootCoordRole, &p.BaseTable)
|
|
|
|
p.ProxyGrpcServerCfg.Init(typeutil.ProxyRole, &p.BaseTable)
|
|
|
|
p.QueryCoordGrpcServerCfg.Init(typeutil.QueryCoordRole, &p.BaseTable)
|
|
|
|
p.QueryNodeGrpcServerCfg.Init(typeutil.QueryNodeRole, &p.BaseTable)
|
|
|
|
p.DataCoordGrpcServerCfg.Init(typeutil.DataCoordRole, &p.BaseTable)
|
|
|
|
p.DataNodeGrpcServerCfg.Init(typeutil.DataNodeRole, &p.BaseTable)
|
|
|
|
p.IndexNodeGrpcServerCfg.Init(typeutil.IndexNodeRole, &p.BaseTable)
|
|
|
|
|
|
|
|
p.RootCoordGrpcClientCfg.Init(typeutil.RootCoordRole, &p.BaseTable)
|
|
|
|
p.ProxyGrpcClientCfg.Init(typeutil.ProxyRole, &p.BaseTable)
|
|
|
|
p.QueryCoordGrpcClientCfg.Init(typeutil.QueryCoordRole, &p.BaseTable)
|
|
|
|
p.QueryNodeGrpcClientCfg.Init(typeutil.QueryNodeRole, &p.BaseTable)
|
|
|
|
p.DataCoordGrpcClientCfg.Init(typeutil.DataCoordRole, &p.BaseTable)
|
|
|
|
p.DataNodeGrpcClientCfg.Init(typeutil.DataNodeRole, &p.BaseTable)
|
|
|
|
p.IndexNodeGrpcClientCfg.Init(typeutil.IndexNodeRole, &p.BaseTable)
|
2023-01-12 19:49:40 +08:00
|
|
|
|
|
|
|
p.IntegrationTestCfg.init(&p.BaseTable)
|
2022-01-10 17:29:34 +08:00
|
|
|
}
|
|
|
|
|
2023-01-13 15:31:41 +08:00
|
|
|
func (p *ComponentParam) GetComponentConfigurations(componentName string, sub string) map[string]string {
|
|
|
|
allownPrefixs := append(globalConfigPrefixs(), componentName+".")
|
|
|
|
return p.mgr.GetBy(config.WithSubstr(sub), config.WithOneOfPrefixs(allownPrefixs...))
|
2022-03-24 10:15:25 +08:00
|
|
|
}
|
|
|
|
|
2023-01-13 15:31:41 +08:00
|
|
|
func (p *ComponentParam) GetAll() map[string]string {
|
|
|
|
return p.mgr.GetConfigs()
|
2022-04-12 19:47:33 +08:00
|
|
|
}
|
|
|
|
|
2023-02-01 16:03:51 +08:00
|
|
|
func (p *ComponentParam) Watch(key string, watcher config.EventHandler) {
|
|
|
|
p.mgr.Dispatcher.Register(key, watcher)
|
|
|
|
}
|
|
|
|
|
2022-10-24 23:43:30 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
2021-12-23 18:39:11 +08:00
|
|
|
// --- common ---
|
2022-01-10 19:03:35 +08:00
|
|
|
type commonConfig struct {
|
2023-01-13 15:31:41 +08:00
|
|
|
ClusterPrefix ParamItem `refreshable:"false"`
|
2022-12-16 15:59:23 +08:00
|
|
|
|
|
|
|
// Deprecated: do not use it anymore
|
|
|
|
ProxySubName ParamItem `refreshable:"true"`
|
|
|
|
|
|
|
|
RootCoordTimeTick ParamItem `refreshable:"true"`
|
|
|
|
RootCoordStatistics ParamItem `refreshable:"true"`
|
|
|
|
RootCoordDml ParamItem `refreshable:"false"`
|
|
|
|
RootCoordDelta ParamItem `refreshable:"false"`
|
|
|
|
// Deprecated: do not use it anymore
|
|
|
|
RootCoordSubName ParamItem `refreshable:"true"`
|
|
|
|
|
|
|
|
// Deprecated: only used in metrics as ID
|
|
|
|
QueryCoordSearch ParamItem `refreshable:"true"`
|
|
|
|
// Deprecated: only used in metrics as ID
|
|
|
|
QueryCoordSearchResult ParamItem `refreshable:"true"`
|
|
|
|
QueryCoordTimeTick ParamItem `refreshable:"true"`
|
|
|
|
QueryNodeSubName ParamItem `refreshable:"false"`
|
|
|
|
|
|
|
|
// Deprecated: do not use it anymore
|
|
|
|
DataCoordStatistic ParamItem `refreshable:"true"`
|
|
|
|
DataCoordTimeTick ParamItem `refreshable:"false"`
|
|
|
|
DataCoordSegmentInfo ParamItem `refreshable:"true"`
|
|
|
|
DataCoordSubName ParamItem `refreshable:"false"`
|
|
|
|
DataCoordWatchSubPath ParamItem `refreshable:"false"`
|
|
|
|
DataNodeSubName ParamItem `refreshable:"false"`
|
|
|
|
|
|
|
|
DefaultPartitionName ParamItem `refreshable:"true"`
|
|
|
|
DefaultIndexName ParamItem `refreshable:"true"`
|
|
|
|
RetentionDuration ParamItem `refreshable:"true"`
|
|
|
|
EntityExpirationTTL ParamItem `refreshable:"true"`
|
|
|
|
|
|
|
|
IndexSliceSize ParamItem `refreshable:"false"`
|
|
|
|
ThreadCoreCoefficient ParamItem `refreshable:"false"`
|
|
|
|
MaxDegree ParamItem `refreshable:"true"`
|
|
|
|
SearchListSize ParamItem `refreshable:"true"`
|
|
|
|
PQCodeBudgetGBRatio ParamItem `refreshable:"true"`
|
|
|
|
BuildNumThreadsRatio ParamItem `refreshable:"true"`
|
|
|
|
SearchCacheBudgetGBRatio ParamItem `refreshable:"true"`
|
|
|
|
LoadNumThreadRatio ParamItem `refreshable:"true"`
|
|
|
|
BeamWidthRatio ParamItem `refreshable:"true"`
|
|
|
|
GracefulTime ParamItem `refreshable:"true"`
|
|
|
|
GracefulStopTimeout ParamItem `refreshable:"true"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-15 14:03:22 +08:00
|
|
|
// Search limit, which applies on:
|
|
|
|
// maximum # of results to return (topK), and
|
|
|
|
// maximum # of search requests (nq).
|
|
|
|
// Check https://milvus.io/docs/limitations.md for more details.
|
2022-12-16 15:59:23 +08:00
|
|
|
TopKLimit ParamItem `refreshable:"true"`
|
|
|
|
StorageType ParamItem `refreshable:"false"`
|
|
|
|
SimdType ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-16 15:59:23 +08:00
|
|
|
AuthorizationEnabled ParamItem `refreshable:"false"`
|
|
|
|
SuperUsers ParamItem `refreshable:"true"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-16 15:59:23 +08:00
|
|
|
ClusterName ParamItem `refreshable:"false"`
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-16 15:59:23 +08:00
|
|
|
SessionTTL ParamItem `refreshable:"false"`
|
|
|
|
SessionRetryTimes ParamItem `refreshable:"false"`
|
2022-02-02 00:35:43 +08:00
|
|
|
}
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
func (p *commonConfig) init(base *BaseTable) {
|
|
|
|
// must init cluster prefix first
|
|
|
|
p.ClusterPrefix = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.cluster",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.cluster"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.ClusterPrefix.Init(base.mgr)
|
|
|
|
|
|
|
|
chanNamePrefix := func(prefix string) string {
|
|
|
|
return strings.Join([]string{p.ClusterPrefix.GetValue(), prefix}, "-")
|
|
|
|
}
|
|
|
|
p.ProxySubName = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.subNamePrefix.proxySubNamePrefix",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.subNamePrefix.proxySubNamePrefix"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.ProxySubName.Init(base.mgr)
|
|
|
|
|
|
|
|
// --- rootcoord ---
|
|
|
|
p.RootCoordTimeTick = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.rootCoordTimeTick",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.rootCoordTimeTick"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.RootCoordTimeTick.Init(base.mgr)
|
|
|
|
|
|
|
|
p.RootCoordStatistics = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.rootCoordStatistics",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.rootCoordStatistics"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.RootCoordStatistics.Init(base.mgr)
|
|
|
|
|
|
|
|
p.RootCoordDml = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.rootCoordDml",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.rootCoordDml"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
2022-12-16 15:59:23 +08:00
|
|
|
Doc: "It is not refreshable currently",
|
2022-12-07 18:01:19 +08:00
|
|
|
}
|
|
|
|
p.RootCoordDml.Init(base.mgr)
|
|
|
|
|
|
|
|
p.RootCoordDelta = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.rootCoordDelta",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.rootCoordDelta"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
2022-12-16 15:59:23 +08:00
|
|
|
Doc: "It is not refreshable currently",
|
2022-12-07 18:01:19 +08:00
|
|
|
}
|
|
|
|
p.RootCoordDelta.Init(base.mgr)
|
|
|
|
|
|
|
|
p.RootCoordSubName = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.subNamePrefix.rootCoordSubNamePrefix",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.subNamePrefix.rootCoordSubNamePrefix"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
2022-12-16 15:59:23 +08:00
|
|
|
Doc: "It is deprecated",
|
2022-12-07 18:01:19 +08:00
|
|
|
}
|
|
|
|
p.RootCoordSubName.Init(base.mgr)
|
|
|
|
|
|
|
|
p.QueryCoordSearch = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.search",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.search"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
2022-12-16 15:59:23 +08:00
|
|
|
Doc: "It is deprecated",
|
2022-12-07 18:01:19 +08:00
|
|
|
}
|
|
|
|
p.QueryCoordSearch.Init(base.mgr)
|
|
|
|
|
|
|
|
p.QueryCoordSearchResult = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.searchResult",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.searchResult"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
2022-12-16 15:59:23 +08:00
|
|
|
Doc: "It is deprecated",
|
2022-12-07 18:01:19 +08:00
|
|
|
}
|
|
|
|
p.QueryCoordSearchResult.Init(base.mgr)
|
|
|
|
|
|
|
|
p.QueryCoordTimeTick = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.queryTimeTick",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.queryTimeTick"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.QueryCoordTimeTick.Init(base.mgr)
|
|
|
|
|
|
|
|
p.QueryNodeSubName = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.subNamePrefix.queryNodeSubNamePrefix",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.subNamePrefix.queryNodeSubNamePrefix"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.QueryNodeSubName.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DataCoordStatistic = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.dataCoordStatistic",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.dataCoordStatistic"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.DataCoordStatistic.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DataCoordTimeTick = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.dataCoordTimeTick",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.dataCoordTimeTick"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.DataCoordTimeTick.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DataCoordSegmentInfo = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.chanNamePrefix.dataCoordSegmentInfo",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.chanNamePrefix.dataCoordSegmentInfo"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.DataCoordSegmentInfo.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DataCoordSubName = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.subNamePrefix.dataCoordSubNamePrefix",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.subNamePrefix.dataCoordSubNamePrefix"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.DataCoordSubName.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DataCoordWatchSubPath = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.subNamePrefix.dataCoordWatchSubPath",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
|
|
|
DefaultValue: "channelwatch",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.DataCoordWatchSubPath.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DataNodeSubName = ParamItem{
|
2023-01-31 10:09:51 +08:00
|
|
|
Key: "msgChannel.subNamePrefix.dataNodeSubNamePrefix",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.1.0",
|
2023-01-31 10:09:51 +08:00
|
|
|
FallbackKeys: []string{"common.subNamePrefix.dataNodeSubNamePrefix"},
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: chanNamePrefix,
|
|
|
|
}
|
|
|
|
p.DataNodeSubName.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DefaultPartitionName = ParamItem{
|
|
|
|
Key: "common.defaultPartitionName",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "_default",
|
|
|
|
}
|
|
|
|
p.DefaultPartitionName.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DefaultIndexName = ParamItem{
|
|
|
|
Key: "common.defaultIndexName",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "_default_idx",
|
|
|
|
}
|
|
|
|
p.DefaultIndexName.Init(base.mgr)
|
|
|
|
|
|
|
|
p.RetentionDuration = ParamItem{
|
|
|
|
Key: "common.retentionDuration",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultRetentionDuration),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.RetentionDuration.Init(base.mgr)
|
|
|
|
|
|
|
|
p.EntityExpirationTTL = ParamItem{
|
|
|
|
Key: "common.entityExpiration",
|
|
|
|
Version: "2.1.0",
|
|
|
|
DefaultValue: "-1",
|
|
|
|
Formatter: func(value string) string {
|
|
|
|
ttl := getAsInt(value)
|
|
|
|
if ttl < 0 {
|
|
|
|
return "-1"
|
|
|
|
}
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
// make sure ttl is larger than retention duration to ensure time travel works
|
|
|
|
if ttl > p.RetentionDuration.GetAsInt() {
|
|
|
|
return strconv.Itoa(ttl)
|
|
|
|
}
|
|
|
|
return p.RetentionDuration.GetValue()
|
|
|
|
},
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EntityExpirationTTL.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SimdType = ParamItem{
|
|
|
|
Key: "common.simdType",
|
|
|
|
Version: "2.1.0",
|
|
|
|
DefaultValue: "auto",
|
|
|
|
FallbackKeys: []string{"knowhere.simdType"},
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SimdType.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.IndexSliceSize = ParamItem{
|
|
|
|
Key: "common.indexSliceSize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultIndexSliceSize),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.IndexSliceSize.Init(base.mgr)
|
2022-02-09 14:41:45 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxDegree = ParamItem{
|
|
|
|
Key: "common.DiskIndex.MaxDegree",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultMaxDegree),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxDegree.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SearchListSize = ParamItem{
|
|
|
|
Key: "common.DiskIndex.SearchListSize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultSearchListSize),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SearchListSize.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.PQCodeBudgetGBRatio = ParamItem{
|
|
|
|
Key: "common.DiskIndex.PQCodeBudgetGBRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: fmt.Sprintf("%f", DefaultPQCodeBudgetGBRatio),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.PQCodeBudgetGBRatio.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.BuildNumThreadsRatio = ParamItem{
|
|
|
|
Key: "common.DiskIndex.BuildNumThreadsRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultBuildNumThreadsRatio),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.BuildNumThreadsRatio.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SearchCacheBudgetGBRatio = ParamItem{
|
|
|
|
Key: "common.DiskIndex.SearchCacheBudgetGBRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: fmt.Sprintf("%f", DefaultSearchCacheBudgetGBRatio),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SearchCacheBudgetGBRatio.Init(base.mgr)
|
2022-03-04 11:17:56 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.LoadNumThreadRatio = ParamItem{
|
|
|
|
Key: "common.DiskIndex.LoadNumThreadRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultLoadNumThreadRatio),
|
2022-04-28 11:51:47 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.LoadNumThreadRatio.Init(base.mgr)
|
2022-04-28 11:51:47 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GracefulStopTimeout = ParamItem{
|
|
|
|
Key: "common.gracefulStopTimeout",
|
|
|
|
Version: "2.2.1",
|
|
|
|
DefaultValue: "30",
|
2022-04-28 11:51:47 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GracefulStopTimeout.Init(base.mgr)
|
2022-04-28 11:51:47 +08:00
|
|
|
|
2022-12-15 14:03:22 +08:00
|
|
|
p.TopKLimit = ParamItem{
|
|
|
|
Key: "common.topKLimit",
|
|
|
|
Version: "2.2.1",
|
|
|
|
DefaultValue: "16384",
|
|
|
|
}
|
|
|
|
p.TopKLimit.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.BeamWidthRatio = ParamItem{
|
|
|
|
Key: "common.DiskIndex.BeamWidthRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultBeamWidthRatio),
|
2022-03-04 11:17:56 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.BeamWidthRatio.Init(base.mgr)
|
2022-10-14 17:51:24 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GracefulTime = ParamItem{
|
|
|
|
Key: "common.gracefulTime",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultGracefulTime),
|
|
|
|
}
|
|
|
|
p.GracefulTime.Init(base.mgr)
|
2022-10-14 17:51:24 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.StorageType = ParamItem{
|
|
|
|
Key: "common.storageType",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "minio",
|
|
|
|
}
|
|
|
|
p.StorageType.Init(base.mgr)
|
2022-10-14 17:51:24 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.ThreadCoreCoefficient = ParamItem{
|
|
|
|
Key: "common.threadCoreCoefficient",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(DefaultThreadCoreCoefficient),
|
|
|
|
}
|
|
|
|
p.ThreadCoreCoefficient.Init(base.mgr)
|
2022-10-14 17:51:24 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AuthorizationEnabled = ParamItem{
|
|
|
|
Key: "common.security.authorizationEnabled",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
}
|
|
|
|
p.AuthorizationEnabled.Init(base.mgr)
|
2022-10-14 17:51:24 +08:00
|
|
|
|
2022-12-09 16:13:20 +08:00
|
|
|
p.SuperUsers = ParamItem{
|
|
|
|
Key: "common.security.superUsers",
|
|
|
|
Version: "2.2.1",
|
|
|
|
}
|
|
|
|
p.SuperUsers.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.ClusterName = ParamItem{
|
|
|
|
Key: "common.cluster.name",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "",
|
|
|
|
}
|
|
|
|
p.ClusterName.Init(base.mgr)
|
2022-05-24 12:05:59 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SessionTTL = ParamItem{
|
|
|
|
Key: "common.session.ttl",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "60",
|
|
|
|
}
|
|
|
|
p.SessionTTL.Init(base.mgr)
|
2022-12-06 22:59:19 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SessionRetryTimes = ParamItem{
|
|
|
|
Key: "common.session.retryTimes",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "30",
|
|
|
|
}
|
|
|
|
p.SessionRetryTimes.Init(base.mgr)
|
2022-04-12 19:47:33 +08:00
|
|
|
|
2022-04-19 16:35:39 +08:00
|
|
|
}
|
|
|
|
|
2023-01-12 16:09:39 +08:00
|
|
|
type traceConfig struct {
|
|
|
|
Exporter ParamItem `refreshable:"false"`
|
|
|
|
SampleFraction ParamItem `refreshable:"false"`
|
|
|
|
JaegerURL ParamItem `refreshable:"false"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (t *traceConfig) init(base *BaseTable) {
|
|
|
|
t.Exporter = ParamItem{
|
|
|
|
Key: "trace.exporter",
|
|
|
|
Version: "2.3.0",
|
|
|
|
}
|
|
|
|
t.Exporter.Init(base.mgr)
|
|
|
|
|
|
|
|
t.SampleFraction = ParamItem{
|
|
|
|
Key: "trace.sampleFraction",
|
|
|
|
Version: "2.3.0",
|
|
|
|
DefaultValue: "1",
|
|
|
|
}
|
|
|
|
t.SampleFraction.Init(base.mgr)
|
|
|
|
|
|
|
|
t.JaegerURL = ParamItem{
|
|
|
|
Key: "trace.jaeger.url",
|
|
|
|
Version: "2.3.0",
|
|
|
|
}
|
|
|
|
t.JaegerURL.Init(base.mgr)
|
|
|
|
}
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
|
|
|
// --- rootcoord ---
|
|
|
|
type rootCoordConfig struct {
|
2022-12-16 15:59:23 +08:00
|
|
|
DmlChannelNum ParamItem `refreshable:"false"`
|
|
|
|
MaxPartitionNum ParamItem `refreshable:"true"`
|
|
|
|
MinSegmentSizeToEnableIndex ParamItem `refreshable:"true"`
|
|
|
|
ImportTaskExpiration ParamItem `refreshable:"true"`
|
|
|
|
ImportTaskRetention ParamItem `refreshable:"true"`
|
2023-01-19 21:31:44 +08:00
|
|
|
ImportMaxPendingTaskCount ParamItem `refreshable:"true"`
|
2022-12-16 15:59:23 +08:00
|
|
|
ImportTaskSubPath ParamItem `refreshable:"true"`
|
|
|
|
EnableActiveStandby ParamItem `refreshable:"false"`
|
2022-08-11 12:12:38 +08:00
|
|
|
}
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
func (p *rootCoordConfig) init(base *BaseTable) {
|
|
|
|
p.DmlChannelNum = ParamItem{
|
|
|
|
Key: "rootCoord.dmlChannelNum",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "256",
|
|
|
|
}
|
|
|
|
p.DmlChannelNum.Init(base.mgr)
|
2022-09-29 18:35:02 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxPartitionNum = ParamItem{
|
|
|
|
Key: "rootCoord.maxPartitionNum",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "4096",
|
|
|
|
}
|
|
|
|
p.MaxPartitionNum.Init(base.mgr)
|
2022-09-29 18:35:02 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MinSegmentSizeToEnableIndex = ParamItem{
|
|
|
|
Key: "rootCoord.minSegmentSizeToEnableIndex",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1024",
|
|
|
|
}
|
|
|
|
p.MinSegmentSizeToEnableIndex.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.ImportTaskExpiration = ParamItem{
|
|
|
|
Key: "rootCoord.importTaskExpiration",
|
|
|
|
Version: "2.2.0",
|
2023-01-04 14:11:33 +08:00
|
|
|
DefaultValue: "900", // 15 * 60 seconds
|
2022-12-07 18:01:19 +08:00
|
|
|
}
|
|
|
|
p.ImportTaskExpiration.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.ImportTaskRetention = ParamItem{
|
|
|
|
Key: "rootCoord.importTaskRetention",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: strconv.Itoa(24 * 60 * 60),
|
|
|
|
}
|
|
|
|
p.ImportTaskRetention.Init(base.mgr)
|
2022-03-25 11:03:25 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.ImportTaskSubPath = ParamItem{
|
|
|
|
Key: "rootCoord.ImportTaskSubPath",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "importtask",
|
|
|
|
}
|
|
|
|
p.ImportTaskSubPath.Init(base.mgr)
|
2022-09-29 18:35:02 +08:00
|
|
|
|
2023-01-19 21:31:44 +08:00
|
|
|
p.ImportMaxPendingTaskCount = ParamItem{
|
|
|
|
Key: "rootCoord.importMaxPendingTaskCount",
|
|
|
|
Version: "2.2.2",
|
|
|
|
DefaultValue: strconv.Itoa(65535),
|
|
|
|
}
|
|
|
|
p.ImportMaxPendingTaskCount.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableActiveStandby = ParamItem{
|
|
|
|
Key: "rootCoord.enableActiveStandby",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
}
|
|
|
|
p.EnableActiveStandby.Init(base.mgr)
|
2022-02-02 00:35:43 +08:00
|
|
|
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
|
|
|
|
2022-10-24 23:43:30 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
2021-12-23 18:39:11 +08:00
|
|
|
// --- proxy ---
|
2022-11-10 17:09:06 +08:00
|
|
|
type AccessLogConfig struct {
|
|
|
|
// if use access log
|
2022-12-16 15:59:23 +08:00
|
|
|
Enable ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
// if upload sealed access log file to minio
|
2022-12-16 15:59:23 +08:00
|
|
|
MinioEnable ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
// Log path
|
2022-12-16 15:59:23 +08:00
|
|
|
LocalPath ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
// Log filename, leave empty to disable file log.
|
2022-12-16 15:59:23 +08:00
|
|
|
Filename ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
// Max size for a single file, in MB.
|
2022-12-16 15:59:23 +08:00
|
|
|
MaxSize ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
// Max time for single access log file in seconds
|
2022-12-16 15:59:23 +08:00
|
|
|
RotatedTime ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
// Maximum number of old log files to retain.
|
2022-12-16 15:59:23 +08:00
|
|
|
MaxBackups ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
//File path in minIO
|
2022-12-16 15:59:23 +08:00
|
|
|
RemotePath ParamItem `refreshable:"false"`
|
2022-12-08 19:39:19 +08:00
|
|
|
//Max time for log file in minIO, in hours
|
2022-12-16 15:59:23 +08:00
|
|
|
RemoteMaxTime ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
}
|
|
|
|
|
2021-12-23 18:39:11 +08:00
|
|
|
type proxyConfig struct {
|
2022-12-07 18:01:19 +08:00
|
|
|
// Alias string
|
2022-12-16 15:59:23 +08:00
|
|
|
SoPath ParamItem `refreshable:"false"`
|
|
|
|
|
|
|
|
TimeTickInterval ParamItem `refreshable:"false"`
|
|
|
|
MsgStreamTimeTickBufSize ParamItem `refreshable:"true"`
|
|
|
|
MaxNameLength ParamItem `refreshable:"true"`
|
|
|
|
MaxUsernameLength ParamItem `refreshable:"true"`
|
|
|
|
MinPasswordLength ParamItem `refreshable:"true"`
|
|
|
|
MaxPasswordLength ParamItem `refreshable:"true"`
|
|
|
|
MaxFieldNum ParamItem `refreshable:"true"`
|
|
|
|
MaxShardNum ParamItem `refreshable:"true"`
|
|
|
|
MaxDimension ParamItem `refreshable:"true"`
|
|
|
|
GinLogging ParamItem `refreshable:"false"`
|
|
|
|
MaxUserNum ParamItem `refreshable:"true"`
|
|
|
|
MaxRoleNum ParamItem `refreshable:"true"`
|
|
|
|
MaxTaskNum ParamItem `refreshable:"false"`
|
2022-11-10 17:09:06 +08:00
|
|
|
AccessLog AccessLogConfig
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
|
|
|
|
2022-02-08 20:57:47 +08:00
|
|
|
func (p *proxyConfig) init(base *BaseTable) {
|
2022-12-07 18:01:19 +08:00
|
|
|
p.TimeTickInterval = ParamItem{
|
|
|
|
Key: "proxy.timeTickInterval",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "200",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.TimeTickInterval.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MsgStreamTimeTickBufSize = ParamItem{
|
|
|
|
Key: "proxy.msgStream.timeTick.bufSize",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "512",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.MsgStreamTimeTickBufSize.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxNameLength = ParamItem{
|
|
|
|
Key: "proxy.maxNameLength",
|
|
|
|
DefaultValue: "255",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.MaxNameLength.Init(base.mgr)
|
2022-09-23 09:50:52 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MinPasswordLength = ParamItem{
|
|
|
|
Key: "proxy.minPasswordLength",
|
|
|
|
DefaultValue: "6",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.MinPasswordLength.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxUsernameLength = ParamItem{
|
|
|
|
Key: "proxy.maxUsernameLength",
|
|
|
|
DefaultValue: "32",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.MaxUsernameLength.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxPasswordLength = ParamItem{
|
|
|
|
Key: "proxy.maxPasswordLength",
|
|
|
|
DefaultValue: "256",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxPasswordLength.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxFieldNum = ParamItem{
|
|
|
|
Key: "proxy.maxFieldNum",
|
|
|
|
DefaultValue: "64",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
2022-04-11 19:49:34 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxFieldNum.Init(base.mgr)
|
2022-04-11 19:49:34 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxShardNum = ParamItem{
|
|
|
|
Key: "proxy.maxShardNum",
|
|
|
|
DefaultValue: "256",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
2022-04-20 13:03:40 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxShardNum.Init(base.mgr)
|
2022-04-20 13:03:40 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxDimension = ParamItem{
|
|
|
|
Key: "proxy.maxDimension",
|
|
|
|
DefaultValue: "32768",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
2022-04-11 19:49:34 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxDimension.Init(base.mgr)
|
2022-04-11 19:49:34 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxTaskNum = ParamItem{
|
|
|
|
Key: "proxy.maxTaskNum",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "1024",
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxTaskNum.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GinLogging = ParamItem{
|
|
|
|
Key: "proxy.ginLogging",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "true",
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GinLogging.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxUserNum = ParamItem{
|
|
|
|
Key: "proxy.maxUserNum",
|
|
|
|
DefaultValue: "100",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxUserNum.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxRoleNum = ParamItem{
|
|
|
|
Key: "proxy.maxRoleNum",
|
|
|
|
DefaultValue: "10",
|
|
|
|
Version: "2.0.0",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.MaxRoleNum.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SoPath = ParamItem{
|
|
|
|
Key: "proxy.soPath",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "",
|
|
|
|
}
|
|
|
|
p.SoPath.Init(base.mgr)
|
2022-03-10 10:35:59 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.Enable = ParamItem{
|
|
|
|
Key: "proxy.accessLog.enable",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "true",
|
2022-08-04 11:04:34 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.Enable.Init(base.mgr)
|
2022-08-04 11:04:34 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.MinioEnable = ParamItem{
|
|
|
|
Key: "proxy.accessLog.minioEnable",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "false",
|
2022-08-04 11:04:34 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.MinioEnable.Init(base.mgr)
|
2022-08-04 11:04:34 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.LocalPath = ParamItem{
|
|
|
|
Key: "proxy.accessLog.localPath",
|
|
|
|
Version: "2.2.0",
|
|
|
|
}
|
|
|
|
p.AccessLog.LocalPath.Init(base.mgr)
|
2022-11-10 17:09:06 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.Filename = ParamItem{
|
|
|
|
Key: "proxy.accessLog.filename",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "milvus_access_log.log",
|
2022-11-10 17:09:06 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.Filename.Init(base.mgr)
|
2022-11-10 17:09:06 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.MaxSize = ParamItem{
|
|
|
|
Key: "proxy.accessLog.maxSize",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "64",
|
2022-11-10 17:09:06 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.MaxSize.Init(base.mgr)
|
2022-11-10 17:09:06 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.MaxBackups = ParamItem{
|
|
|
|
Key: "proxy.accessLog.maxBackups",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "8",
|
2022-11-10 17:09:06 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.MaxBackups.Init(base.mgr)
|
2022-11-10 17:09:06 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.RotatedTime = ParamItem{
|
|
|
|
Key: "proxy.accessLog.rotatedTime",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "3600",
|
|
|
|
}
|
|
|
|
p.AccessLog.RotatedTime.Init(base.mgr)
|
2022-11-10 17:09:06 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AccessLog.RemotePath = ParamItem{
|
|
|
|
Key: "proxy.accessLog.remotePath",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "access_log/",
|
|
|
|
}
|
|
|
|
p.AccessLog.RemotePath.Init(base.mgr)
|
2022-12-08 19:39:19 +08:00
|
|
|
|
|
|
|
p.AccessLog.RemoteMaxTime = ParamItem{
|
|
|
|
Key: "proxy.accessLog.remoteMaxTime",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "168",
|
|
|
|
}
|
|
|
|
p.AccessLog.RemoteMaxTime.Init(base.mgr)
|
2022-11-10 17:09:06 +08:00
|
|
|
}
|
|
|
|
|
2022-11-29 17:19:14 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
2021-12-23 18:39:11 +08:00
|
|
|
// --- querycoord ---
|
|
|
|
type queryCoordConfig struct {
|
2022-12-16 15:59:23 +08:00
|
|
|
//Deprecated: Since 2.2.0
|
|
|
|
RetryNum ParamItem `refreshable:"true"`
|
|
|
|
//Deprecated: Since 2.2.0
|
|
|
|
RetryInterval ParamItem `refreshable:"true"`
|
|
|
|
TaskMergeCap ParamItem `refreshable:"false"`
|
|
|
|
TaskExecutionCap ParamItem `refreshable:"true"`
|
2022-07-18 13:06:28 +08:00
|
|
|
|
2021-12-23 18:39:11 +08:00
|
|
|
//---- Handoff ---
|
2022-12-16 15:59:23 +08:00
|
|
|
//Deprecated: Since 2.2.2
|
|
|
|
AutoHandoff ParamItem `refreshable:"true"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
|
|
|
//---- Balance ---
|
2022-12-16 15:59:23 +08:00
|
|
|
AutoBalance ParamItem `refreshable:"true"`
|
|
|
|
OverloadedMemoryThresholdPercentage ParamItem `refreshable:"true"`
|
|
|
|
BalanceIntervalSeconds ParamItem `refreshable:"true"`
|
|
|
|
MemoryUsageMaxDifferencePercentage ParamItem `refreshable:"true"`
|
|
|
|
CheckInterval ParamItem `refreshable:"true"`
|
|
|
|
ChannelTaskTimeout ParamItem `refreshable:"true"`
|
|
|
|
SegmentTaskTimeout ParamItem `refreshable:"true"`
|
|
|
|
DistPullInterval ParamItem `refreshable:"false"`
|
|
|
|
HeartbeatAvailableInterval ParamItem `refreshable:"true"`
|
|
|
|
LoadTimeoutSeconds ParamItem `refreshable:"true"`
|
|
|
|
//Deprecated: Since 2.2.2, QueryCoord do not use HandOff logic anymore
|
|
|
|
CheckHandoffInterval ParamItem `refreshable:"true"`
|
|
|
|
EnableActiveStandby ParamItem `refreshable:"false"`
|
|
|
|
|
2023-01-30 10:19:48 +08:00
|
|
|
NextTargetSurviveTime ParamItem `refreshable:"true"`
|
|
|
|
UpdateNextTargetInterval ParamItem `refreshable:"false"`
|
|
|
|
CheckNodeInReplicaInterval ParamItem `refreshable:"false"`
|
|
|
|
CheckResourceGroupInterval ParamItem `refreshable:"false"`
|
|
|
|
EnableRGAutoRecover ParamItem `refreshable:"true"`
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
|
|
|
|
2022-02-08 20:57:47 +08:00
|
|
|
func (p *queryCoordConfig) init(base *BaseTable) {
|
2022-07-18 13:06:28 +08:00
|
|
|
//---- Task ---
|
2022-12-07 18:01:19 +08:00
|
|
|
p.RetryNum = ParamItem{
|
|
|
|
Key: "queryCoord.task.retrynum",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "5",
|
|
|
|
}
|
|
|
|
p.RetryNum.Init(base.mgr)
|
2022-07-18 13:06:28 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.RetryInterval = ParamItem{
|
|
|
|
Key: "queryCoord.task.retryinterval",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: strconv.FormatInt(int64(10*time.Second), 10),
|
|
|
|
}
|
|
|
|
p.RetryInterval.Init(base.mgr)
|
2022-09-24 17:56:51 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.TaskMergeCap = ParamItem{
|
|
|
|
Key: "queryCoord.taskMergeCap",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "16",
|
|
|
|
}
|
|
|
|
p.TaskMergeCap.Init(base.mgr)
|
2022-11-30 13:57:15 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.TaskExecutionCap = ParamItem{
|
|
|
|
Key: "queryCoord.taskExecutionCap",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "256",
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.TaskExecutionCap.Init(base.mgr)
|
|
|
|
|
|
|
|
p.AutoHandoff = ParamItem{
|
|
|
|
Key: "queryCoord.autoHandoff",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "true",
|
|
|
|
PanicIfEmpty: true,
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AutoHandoff.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AutoBalance = ParamItem{
|
|
|
|
Key: "queryCoord.autoBalance",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
PanicIfEmpty: true,
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.AutoBalance.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.OverloadedMemoryThresholdPercentage = ParamItem{
|
|
|
|
Key: "queryCoord.overloadedMemoryThresholdPercentage",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "90",
|
|
|
|
PanicIfEmpty: true,
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.OverloadedMemoryThresholdPercentage.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.BalanceIntervalSeconds = ParamItem{
|
|
|
|
Key: "queryCoord.balanceIntervalSeconds",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "60",
|
|
|
|
PanicIfEmpty: true,
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.BalanceIntervalSeconds.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MemoryUsageMaxDifferencePercentage = ParamItem{
|
|
|
|
Key: "queryCoord.memoryUsageMaxDifferencePercentage",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "30",
|
|
|
|
PanicIfEmpty: true,
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MemoryUsageMaxDifferencePercentage.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.CheckInterval = ParamItem{
|
|
|
|
Key: "queryCoord.checkInterval",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1000",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.CheckInterval.Init(base.mgr)
|
2022-09-29 18:35:02 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.ChannelTaskTimeout = ParamItem{
|
|
|
|
Key: "queryCoord.channelTaskTimeout",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "60000",
|
|
|
|
PanicIfEmpty: true,
|
2022-09-15 18:48:32 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.ChannelTaskTimeout.Init(base.mgr)
|
2022-09-15 18:48:32 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentTaskTimeout = ParamItem{
|
|
|
|
Key: "queryCoord.segmentTaskTimeout",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "120000",
|
|
|
|
PanicIfEmpty: true,
|
2022-09-15 18:48:32 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentTaskTimeout.Init(base.mgr)
|
2022-09-15 18:48:32 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.DistPullInterval = ParamItem{
|
|
|
|
Key: "queryCoord.distPullInterval",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "500",
|
|
|
|
PanicIfEmpty: true,
|
2022-09-15 18:48:32 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.DistPullInterval.Init(base.mgr)
|
2022-09-15 18:48:32 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.LoadTimeoutSeconds = ParamItem{
|
|
|
|
Key: "queryCoord.loadTimeoutSeconds",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "600",
|
|
|
|
PanicIfEmpty: true,
|
2022-09-15 18:48:32 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.LoadTimeoutSeconds.Init(base.mgr)
|
2022-12-05 15:09:20 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.HeartbeatAvailableInterval = ParamItem{
|
|
|
|
Key: "queryCoord.heartbeatAvailableInterval",
|
|
|
|
Version: "2.2.1",
|
2022-12-08 19:09:18 +08:00
|
|
|
DefaultValue: "10000",
|
2022-12-07 18:01:19 +08:00
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.HeartbeatAvailableInterval.Init(base.mgr)
|
2022-09-15 18:48:32 +08:00
|
|
|
|
2022-12-16 15:59:23 +08:00
|
|
|
p.CheckHandoffInterval = ParamItem{
|
|
|
|
Key: "queryCoord.checkHandoffInterval",
|
|
|
|
DefaultValue: "5000",
|
|
|
|
Version: "2.2.0",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.CheckHandoffInterval.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableActiveStandby = ParamItem{
|
|
|
|
Key: "queryCoord.enableActiveStandby",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "false",
|
2022-09-15 18:48:32 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableActiveStandby.Init(base.mgr)
|
2022-09-15 18:48:32 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.NextTargetSurviveTime = ParamItem{
|
|
|
|
Key: "queryCoord.NextTargetSurviveTime",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "300",
|
|
|
|
PanicIfEmpty: true,
|
2022-11-07 19:37:04 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.NextTargetSurviveTime.Init(base.mgr)
|
2022-11-07 19:37:04 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.UpdateNextTargetInterval = ParamItem{
|
|
|
|
Key: "queryCoord.UpdateNextTargetInterval",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10",
|
|
|
|
PanicIfEmpty: true,
|
2022-11-07 19:37:04 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.UpdateNextTargetInterval.Init(base.mgr)
|
2023-01-30 10:19:48 +08:00
|
|
|
|
|
|
|
p.CheckNodeInReplicaInterval = ParamItem{
|
|
|
|
Key: "queryCoord.checkNodeInReplicaInterval",
|
|
|
|
Version: "2.2.3",
|
|
|
|
DefaultValue: "60",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.CheckNodeInReplicaInterval.Init(base.mgr)
|
|
|
|
|
|
|
|
p.CheckResourceGroupInterval = ParamItem{
|
|
|
|
Key: "queryCoord.checkResourceGroupInterval",
|
|
|
|
Version: "2.2.3",
|
|
|
|
DefaultValue: "30",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.CheckResourceGroupInterval.Init(base.mgr)
|
|
|
|
|
|
|
|
p.EnableRGAutoRecover = ParamItem{
|
|
|
|
Key: "queryCoord.enableRGAutoRecover",
|
|
|
|
Version: "2.2.3",
|
|
|
|
DefaultValue: "true",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.EnableRGAutoRecover.Init(base.mgr)
|
2022-11-07 19:37:04 +08:00
|
|
|
}
|
|
|
|
|
2022-10-24 23:43:30 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
2021-12-23 18:39:11 +08:00
|
|
|
// --- querynode ---
|
|
|
|
type queryNodeConfig struct {
|
2022-12-16 15:59:23 +08:00
|
|
|
FlowGraphMaxQueueLength ParamItem `refreshable:"false"`
|
|
|
|
FlowGraphMaxParallelism ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
|
|
|
// stats
|
2022-12-16 15:59:23 +08:00
|
|
|
//Deprecated: Never used
|
|
|
|
StatsPublishInterval ParamItem `refreshable:"true"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
|
|
|
// segcore
|
2022-12-16 15:59:23 +08:00
|
|
|
ChunkRows ParamItem `refreshable:"false"`
|
|
|
|
SmallIndexNlist ParamItem `refreshable:"false"`
|
|
|
|
SmallIndexNProbe ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
|
|
|
// memory limit
|
2022-12-16 15:59:23 +08:00
|
|
|
LoadMemoryUsageFactor ParamItem `refreshable:"true"`
|
|
|
|
OverloadedMemoryThresholdPercentage ParamItem `refreshable:"false"`
|
2022-03-26 22:05:26 +08:00
|
|
|
|
2022-09-21 20:16:51 +08:00
|
|
|
// enable disk
|
2022-12-16 15:59:23 +08:00
|
|
|
EnableDisk ParamItem `refreshable:"true"`
|
|
|
|
DiskCapacityLimit ParamItem `refreshable:"true"`
|
|
|
|
MaxDiskUsagePercentage ParamItem `refreshable:"true"`
|
2022-09-21 20:16:51 +08:00
|
|
|
|
2022-03-26 22:05:26 +08:00
|
|
|
// cache limit
|
2022-12-16 15:59:23 +08:00
|
|
|
CacheEnabled ParamItem `refreshable:"false"`
|
|
|
|
CacheMemoryLimit ParamItem `refreshable:"false"`
|
|
|
|
|
|
|
|
GroupEnabled ParamItem `refreshable:"true"`
|
|
|
|
MaxReceiveChanSize ParamItem `refreshable:"false"`
|
|
|
|
MaxUnsolvedQueueSize ParamItem `refreshable:"true"`
|
|
|
|
MaxReadConcurrency ParamItem `refreshable:"true"`
|
|
|
|
MaxGroupNQ ParamItem `refreshable:"true"`
|
|
|
|
TopKMergeRatio ParamItem `refreshable:"true"`
|
|
|
|
CPURatio ParamItem `refreshable:"true"`
|
2022-12-29 15:17:30 +08:00
|
|
|
MaxTimestampLag ParamItem `refreshable:"true"`
|
2022-12-16 15:59:23 +08:00
|
|
|
|
|
|
|
GCHelperEnabled ParamItem `refreshable:"false"`
|
|
|
|
MinimumGOGCConfig ParamItem `refreshable:"false"`
|
|
|
|
MaximumGOGCConfig ParamItem `refreshable:"false"`
|
|
|
|
GracefulStopTimeout ParamItem `refreshable:"false"`
|
2022-12-07 18:01:19 +08:00
|
|
|
}
|
2022-05-23 16:41:58 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
func (p *queryNodeConfig) init(base *BaseTable) {
|
|
|
|
p.FlowGraphMaxQueueLength = ParamItem{
|
|
|
|
Key: "queryNode.dataSync.flowGraph.maxQueueLength",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1024",
|
|
|
|
}
|
|
|
|
p.FlowGraphMaxQueueLength.Init(base.mgr)
|
|
|
|
|
|
|
|
p.FlowGraphMaxParallelism = ParamItem{
|
|
|
|
Key: "queryNode.dataSync.flowGraph.maxParallelism",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1024",
|
|
|
|
}
|
|
|
|
p.FlowGraphMaxParallelism.Init(base.mgr)
|
|
|
|
|
|
|
|
p.StatsPublishInterval = ParamItem{
|
|
|
|
Key: "queryNode.stats.publishInterval",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1000",
|
|
|
|
}
|
|
|
|
p.StatsPublishInterval.Init(base.mgr)
|
|
|
|
|
|
|
|
p.ChunkRows = ParamItem{
|
|
|
|
Key: "queryNode.segcore.chunkRows",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1024",
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
if getAsInt(v) < 1024 {
|
|
|
|
return "1024"
|
|
|
|
}
|
|
|
|
return v
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.ChunkRows.Init(base.mgr)
|
|
|
|
|
|
|
|
p.SmallIndexNlist = ParamItem{
|
|
|
|
Key: "queryNode.segcore.smallIndex.nlist",
|
|
|
|
Version: "2.0.0",
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
rows := p.ChunkRows.GetAsInt64()
|
|
|
|
var defaultNList int64
|
|
|
|
for i := int64(0); i < rows; i++ {
|
|
|
|
if math.Pow(2.0, float64(i)) > math.Sqrt(float64(rows)) {
|
|
|
|
defaultNList = int64(math.Pow(2, float64(i)))
|
|
|
|
break
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
nlist := getAsInt64(v)
|
|
|
|
if nlist == 0 {
|
|
|
|
nlist = defaultNList
|
|
|
|
}
|
|
|
|
if nlist > rows/8 {
|
|
|
|
return strconv.FormatInt(rows/8, 10)
|
|
|
|
}
|
|
|
|
return strconv.FormatInt(nlist, 10)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.SmallIndexNlist.Init(base.mgr)
|
|
|
|
|
|
|
|
p.SmallIndexNProbe = ParamItem{
|
|
|
|
Key: "queryNode.segcore.smallIndex.nprobe",
|
|
|
|
Version: "2.0.0",
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
defaultNprobe := p.SmallIndexNlist.GetAsInt64() / 16
|
|
|
|
nprobe := getAsInt64(v)
|
|
|
|
if nprobe == 0 {
|
|
|
|
nprobe = defaultNprobe
|
|
|
|
}
|
|
|
|
if nprobe > p.SmallIndexNlist.GetAsInt64() {
|
|
|
|
return p.SmallIndexNlist.GetValue()
|
|
|
|
}
|
|
|
|
return strconv.FormatInt(nprobe, 10)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.SmallIndexNProbe.Init(base.mgr)
|
|
|
|
|
|
|
|
p.LoadMemoryUsageFactor = ParamItem{
|
|
|
|
Key: "queryNode.loadMemoryUsageFactor",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "3",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.LoadMemoryUsageFactor.Init(base.mgr)
|
|
|
|
|
|
|
|
p.OverloadedMemoryThresholdPercentage = ParamItem{
|
|
|
|
Key: "queryCoord.overloadedMemoryThresholdPercentage",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "90",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
return fmt.Sprintf("%f", getAsFloat(v)/100)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.OverloadedMemoryThresholdPercentage.Init(base.mgr)
|
|
|
|
|
|
|
|
p.CacheMemoryLimit = ParamItem{
|
|
|
|
Key: "queryNode.cache.memoryLimit",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "2147483648",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.CacheMemoryLimit.Init(base.mgr)
|
|
|
|
|
|
|
|
p.CacheEnabled = ParamItem{
|
|
|
|
Key: "queryNode.cache.enabled",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "",
|
|
|
|
}
|
|
|
|
p.CacheEnabled.Init(base.mgr)
|
|
|
|
|
|
|
|
p.GroupEnabled = ParamItem{
|
|
|
|
Key: "queryNode.grouping.enabled",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "true",
|
|
|
|
}
|
|
|
|
p.GroupEnabled.Init(base.mgr)
|
|
|
|
|
|
|
|
p.MaxReceiveChanSize = ParamItem{
|
|
|
|
Key: "queryNode.scheduler.receiveChanSize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10240",
|
|
|
|
}
|
|
|
|
p.MaxReceiveChanSize.Init(base.mgr)
|
|
|
|
|
|
|
|
p.MaxReadConcurrency = ParamItem{
|
|
|
|
Key: "queryNode.scheduler.maxReadConcurrentRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "2.0",
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
ratio := getAsFloat(v)
|
|
|
|
cpuNum := int64(runtime.GOMAXPROCS(0))
|
|
|
|
concurrency := int64(float64(cpuNum) * ratio)
|
|
|
|
if concurrency < 1 {
|
|
|
|
return "1" // MaxReadConcurrency must >= 1
|
|
|
|
} else if concurrency > cpuNum*100 {
|
|
|
|
return strconv.FormatInt(cpuNum*100, 10) // MaxReadConcurrency must <= 100*cpuNum
|
|
|
|
}
|
|
|
|
return strconv.FormatInt(concurrency, 10)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.MaxReadConcurrency.Init(base.mgr)
|
|
|
|
|
|
|
|
p.MaxUnsolvedQueueSize = ParamItem{
|
|
|
|
Key: "queryNode.scheduler.unsolvedQueueSize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10240",
|
|
|
|
}
|
|
|
|
p.MaxUnsolvedQueueSize.Init(base.mgr)
|
|
|
|
|
|
|
|
p.MaxGroupNQ = ParamItem{
|
|
|
|
Key: "queryNode.grouping.maxNQ",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1000",
|
|
|
|
}
|
|
|
|
p.MaxGroupNQ.Init(base.mgr)
|
|
|
|
|
|
|
|
p.TopKMergeRatio = ParamItem{
|
|
|
|
Key: "queryNode.grouping.topKMergeRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10.0",
|
|
|
|
}
|
|
|
|
p.TopKMergeRatio.Init(base.mgr)
|
|
|
|
|
|
|
|
p.CPURatio = ParamItem{
|
|
|
|
Key: "queryNode.scheduler.cpuRatio",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10",
|
|
|
|
}
|
|
|
|
p.CPURatio.Init(base.mgr)
|
|
|
|
|
|
|
|
p.EnableDisk = ParamItem{
|
|
|
|
Key: "queryNode.enableDisk",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
}
|
|
|
|
p.EnableDisk.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DiskCapacityLimit = ParamItem{
|
|
|
|
Key: "LOCAL_STORAGE_SIZE",
|
|
|
|
Version: "2.2.0",
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
if len(v) == 0 {
|
|
|
|
diskUsage, err := disk.Usage("/")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return strconv.FormatUint(diskUsage.Total, 10)
|
|
|
|
}
|
|
|
|
diskSize := getAsInt64(v)
|
|
|
|
return strconv.FormatInt(diskSize*1024*1024*1024, 10)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.DiskCapacityLimit.Init(base.mgr)
|
|
|
|
|
|
|
|
p.MaxDiskUsagePercentage = ParamItem{
|
|
|
|
Key: "queryNode.maxDiskUsagePercentage",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "95",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
return fmt.Sprintf("%f", getAsFloat(v)/100)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.MaxDiskUsagePercentage.Init(base.mgr)
|
|
|
|
|
2022-12-29 15:17:30 +08:00
|
|
|
p.MaxTimestampLag = ParamItem{
|
|
|
|
Key: "queryNode.scheduler.maxTimestampLag",
|
|
|
|
Version: "2.2.3",
|
|
|
|
DefaultValue: "86400",
|
|
|
|
}
|
|
|
|
p.MaxTimestampLag.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
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",
|
|
|
|
FallbackKeys: []string{"common.gracefulStopTimeout"},
|
|
|
|
}
|
|
|
|
p.GracefulStopTimeout.Init(base.mgr)
|
|
|
|
}
|
2022-11-04 22:25:01 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
|
|
|
// --- datacoord ---
|
|
|
|
type dataCoordConfig struct {
|
2022-12-06 22:59:19 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
// --- CHANNEL ---
|
2022-12-16 15:59:23 +08:00
|
|
|
MaxWatchDuration ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
// --- SEGMENTS ---
|
2022-12-16 15:59:23 +08:00
|
|
|
SegmentMaxSize ParamItem `refreshable:"false"`
|
|
|
|
DiskSegmentMaxSize ParamItem `refreshable:"true"`
|
|
|
|
SegmentSealProportion ParamItem `refreshable:"false"`
|
|
|
|
SegAssignmentExpiration ParamItem `refreshable:"true"`
|
|
|
|
SegmentMaxLifetime ParamItem `refreshable:"false"`
|
|
|
|
SegmentMaxIdleTime ParamItem `refreshable:"false"`
|
|
|
|
SegmentMinSizeFromIdleToSealed ParamItem `refreshable:"false"`
|
2022-12-20 14:09:25 +08:00
|
|
|
SegmentMaxBinlogFileNumber ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
// compaction
|
2022-12-16 15:59:23 +08:00
|
|
|
EnableCompaction ParamItem `refreshable:"false"`
|
|
|
|
EnableAutoCompaction ParamItem `refreshable:"true"`
|
|
|
|
|
|
|
|
MinSegmentToMerge ParamItem `refreshable:"true"`
|
|
|
|
MaxSegmentToMerge ParamItem `refreshable:"true"`
|
|
|
|
SegmentSmallProportion ParamItem `refreshable:"true"`
|
|
|
|
SegmentCompactableProportion ParamItem `refreshable:"true"`
|
|
|
|
SegmentExpansionRate ParamItem `refreshable:"true"`
|
|
|
|
CompactionTimeoutInSeconds ParamItem `refreshable:"true"`
|
|
|
|
CompactionCheckIntervalInSeconds ParamItem `refreshable:"false"`
|
|
|
|
SingleCompactionRatioThreshold ParamItem `refreshable:"true"`
|
|
|
|
SingleCompactionDeltaLogMaxSize ParamItem `refreshable:"true"`
|
|
|
|
SingleCompactionExpiredLogMaxSize ParamItem `refreshable:"true"`
|
|
|
|
SingleCompactionDeltalogMaxNum ParamItem `refreshable:"true"`
|
|
|
|
GlobalCompactionInterval ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
// Garbage Collection
|
2022-12-16 15:59:23 +08:00
|
|
|
EnableGarbageCollection ParamItem `refreshable:"false"`
|
|
|
|
GCInterval ParamItem `refreshable:"false"`
|
|
|
|
GCMissingTolerance ParamItem `refreshable:"false"`
|
|
|
|
GCDropTolerance ParamItem `refreshable:"false"`
|
|
|
|
EnableActiveStandby ParamItem `refreshable:"false"`
|
2023-01-04 19:37:36 +08:00
|
|
|
|
|
|
|
BindIndexNodeMode ParamItem `refreshable:"false"`
|
|
|
|
IndexNodeAddress ParamItem `refreshable:"false"`
|
|
|
|
WithCredential ParamItem `refreshable:"false"`
|
|
|
|
IndexNodeID ParamItem `refreshable:"false"`
|
|
|
|
|
|
|
|
MinSegmentNumRowsToEnableIndex ParamItem `refreshable:"true"`
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
func (p *dataCoordConfig) init(base *BaseTable) {
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxWatchDuration = ParamItem{
|
|
|
|
Key: "dataCoord.channel.maxWatchDuration",
|
|
|
|
Version: "2.2.1",
|
|
|
|
DefaultValue: "60",
|
2022-05-05 09:49:50 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxWatchDuration.Init(base.mgr)
|
2022-05-05 09:49:50 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMaxSize = ParamItem{
|
|
|
|
Key: "dataCoord.segment.maxSize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "512",
|
2022-05-05 09:49:50 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMaxSize.Init(base.mgr)
|
2022-05-05 09:49:50 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.DiskSegmentMaxSize = ParamItem{
|
|
|
|
Key: "dataCoord.segment.diskSegmentMaxSize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "512",
|
2022-05-05 09:49:50 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.DiskSegmentMaxSize.Init(base.mgr)
|
2022-05-05 09:49:50 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentSealProportion = ParamItem{
|
|
|
|
Key: "dataCoord.segment.sealProportion",
|
|
|
|
Version: "2.0.0",
|
2022-12-15 18:31:23 +08:00
|
|
|
DefaultValue: "0.25",
|
2022-05-05 09:49:50 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentSealProportion.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegAssignmentExpiration = ParamItem{
|
|
|
|
Key: "dataCoord.segment.assignmentExpiration",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "2000",
|
2022-06-09 18:16:07 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegAssignmentExpiration.Init(base.mgr)
|
2022-06-09 18:16:07 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMaxLifetime = ParamItem{
|
|
|
|
Key: "dataCoord.segment.maxLife",
|
|
|
|
Version: "2.0.0",
|
2022-12-15 18:31:23 +08:00
|
|
|
DefaultValue: "86400",
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMaxLifetime.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMaxIdleTime = ParamItem{
|
|
|
|
Key: "dataCoord.segment.maxIdleTime",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "3600",
|
2022-04-07 22:05:32 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMaxIdleTime.Init(base.mgr)
|
2022-04-24 22:03:44 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMinSizeFromIdleToSealed = ParamItem{
|
|
|
|
Key: "dataCoord.segment.minSizeFromIdleToSealed",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "16.0",
|
2022-03-26 22:05:26 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentMinSizeFromIdleToSealed.Init(base.mgr)
|
2022-03-26 22:05:26 +08:00
|
|
|
|
2022-12-20 14:09:25 +08:00
|
|
|
p.SegmentMaxBinlogFileNumber = ParamItem{
|
|
|
|
Key: "dataCoord.segment.maxBinlogFileNumber",
|
2023-02-03 17:07:52 +08:00
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "16",
|
2022-12-20 14:09:25 +08:00
|
|
|
}
|
|
|
|
p.SegmentMaxBinlogFileNumber.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableCompaction = ParamItem{
|
|
|
|
Key: "dataCoord.enableCompaction",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "false",
|
2022-07-04 15:10:20 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableCompaction.Init(base.mgr)
|
2022-05-23 16:41:58 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableAutoCompaction = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.enableAutoCompaction",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "false",
|
2022-09-21 20:16:51 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableAutoCompaction.Init(base.mgr)
|
2022-09-21 20:16:51 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MinSegmentToMerge = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.min.segment",
|
|
|
|
Version: "2.0.0",
|
2022-12-12 10:33:26 +08:00
|
|
|
DefaultValue: "3",
|
2022-09-21 20:16:51 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MinSegmentToMerge.Init(base.mgr)
|
2022-09-21 20:16:51 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxSegmentToMerge = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.max.segment",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "30",
|
2022-09-21 20:16:51 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.MaxSegmentToMerge.Init(base.mgr)
|
2022-09-21 20:16:51 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentSmallProportion = ParamItem{
|
|
|
|
Key: "dataCoord.segment.smallProportion",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "0.5",
|
2022-09-21 20:16:51 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentSmallProportion.Init(base.mgr)
|
2022-06-15 23:14:10 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SegmentCompactableProportion = ParamItem{
|
|
|
|
Key: "dataCoord.segment.compactableProportion",
|
|
|
|
Version: "2.2.1",
|
|
|
|
DefaultValue: "0.5",
|
|
|
|
}
|
|
|
|
p.SegmentCompactableProportion.Init(base.mgr)
|
2022-08-23 15:50:52 +08:00
|
|
|
|
2022-12-09 16:03:20 +08:00
|
|
|
p.SegmentExpansionRate = ParamItem{
|
|
|
|
Key: "dataCoord.segment.expansionRate",
|
|
|
|
Version: "2.2.1",
|
|
|
|
DefaultValue: "1.25",
|
|
|
|
}
|
|
|
|
p.SegmentExpansionRate.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.CompactionTimeoutInSeconds = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.timeout",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "180",
|
|
|
|
}
|
|
|
|
p.CompactionTimeoutInSeconds.Init(base.mgr)
|
2022-06-15 23:14:10 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.CompactionCheckIntervalInSeconds = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.check.interval",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10",
|
|
|
|
}
|
|
|
|
p.CompactionCheckIntervalInSeconds.Init(base.mgr)
|
2022-06-15 23:14:10 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SingleCompactionRatioThreshold = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.single.ratio.threshold",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "0.2",
|
|
|
|
}
|
|
|
|
p.SingleCompactionRatioThreshold.Init(base.mgr)
|
2022-06-15 23:14:10 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SingleCompactionDeltaLogMaxSize = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.single.deltalog.maxsize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: strconv.Itoa(2 * 1024 * 1024),
|
|
|
|
}
|
|
|
|
p.SingleCompactionDeltaLogMaxSize.Init(base.mgr)
|
2022-06-15 23:14:10 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SingleCompactionExpiredLogMaxSize = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.single.expiredlog.maxsize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10485760",
|
|
|
|
}
|
|
|
|
p.SingleCompactionExpiredLogMaxSize.Init(base.mgr)
|
2022-06-15 23:14:10 +08:00
|
|
|
|
2022-12-12 10:33:26 +08:00
|
|
|
p.SingleCompactionDeltalogMaxNum = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.single.deltalog.maxnum",
|
2022-12-07 18:01:19 +08:00
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1000",
|
|
|
|
}
|
2022-12-12 10:33:26 +08:00
|
|
|
p.SingleCompactionDeltalogMaxNum.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GlobalCompactionInterval = ParamItem{
|
|
|
|
Key: "dataCoord.compaction.global.interval",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "60",
|
|
|
|
}
|
|
|
|
p.GlobalCompactionInterval.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableGarbageCollection = ParamItem{
|
|
|
|
Key: "dataCoord.enableGarbageCollection",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "true",
|
|
|
|
}
|
|
|
|
p.EnableGarbageCollection.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GCInterval = ParamItem{
|
|
|
|
Key: "dataCoord.gc.interval",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "3600",
|
|
|
|
}
|
|
|
|
p.GCInterval.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GCMissingTolerance = ParamItem{
|
|
|
|
Key: "dataCoord.gc.missingTolerance",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "86400",
|
|
|
|
}
|
|
|
|
p.GCMissingTolerance.Init(base.mgr)
|
2022-06-06 15:10:05 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GCDropTolerance = ParamItem{
|
|
|
|
Key: "dataCoord.gc.dropTolerance",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "86400",
|
2022-06-06 15:10:05 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.GCDropTolerance.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.EnableActiveStandby = ParamItem{
|
|
|
|
Key: "dataCoord.enableActiveStandby",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
}
|
|
|
|
p.EnableActiveStandby.Init(base.mgr)
|
2023-01-04 19:37:36 +08:00
|
|
|
|
|
|
|
p.MinSegmentNumRowsToEnableIndex = ParamItem{
|
2023-01-31 12:07:50 +08:00
|
|
|
Key: "indexCoord.segment.minSegmentNumRowsToEnableIndex",
|
2023-01-04 19:37:36 +08:00
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1024",
|
|
|
|
}
|
|
|
|
p.MinSegmentNumRowsToEnableIndex.Init(base.mgr)
|
|
|
|
|
|
|
|
p.BindIndexNodeMode = ParamItem{
|
2023-01-31 12:07:50 +08:00
|
|
|
Key: "indexCoord.bindIndexNodeMode.enable",
|
2023-01-04 19:37:36 +08:00
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
}
|
|
|
|
p.BindIndexNodeMode.Init(base.mgr)
|
|
|
|
|
|
|
|
p.IndexNodeAddress = ParamItem{
|
2023-01-31 12:07:50 +08:00
|
|
|
Key: "indexCoord.bindIndexNodeMode.address",
|
2023-01-04 19:37:36 +08:00
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "localhost:22930",
|
|
|
|
}
|
|
|
|
p.IndexNodeAddress.Init(base.mgr)
|
|
|
|
|
|
|
|
p.WithCredential = ParamItem{
|
2023-01-31 12:07:50 +08:00
|
|
|
Key: "indexCoord.bindIndexNodeMode.withCred",
|
2023-01-04 19:37:36 +08:00
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
}
|
|
|
|
p.WithCredential.Init(base.mgr)
|
|
|
|
|
|
|
|
p.IndexNodeID = ParamItem{
|
2023-01-31 12:07:50 +08:00
|
|
|
Key: "indexCoord.bindIndexNodeMode.nodeID",
|
2023-01-04 19:37:36 +08:00
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "0",
|
|
|
|
}
|
|
|
|
p.IndexNodeID.Init(base.mgr)
|
2022-09-29 18:35:02 +08:00
|
|
|
}
|
|
|
|
|
2022-10-24 23:43:30 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
2021-12-23 18:39:11 +08:00
|
|
|
// --- datanode ---
|
|
|
|
type dataNodeConfig struct {
|
2022-12-16 15:59:23 +08:00
|
|
|
FlowGraphMaxQueueLength ParamItem `refreshable:"false"`
|
|
|
|
FlowGraphMaxParallelism ParamItem `refreshable:"false"`
|
2022-11-12 21:09:04 +08:00
|
|
|
|
|
|
|
// segment
|
2022-12-16 15:59:23 +08:00
|
|
|
FlushInsertBufferSize ParamItem `refreshable:"true"`
|
|
|
|
FlushDeleteBufferBytes ParamItem `refreshable:"true"`
|
|
|
|
BinLogMaxSize ParamItem `refreshable:"true"`
|
|
|
|
SyncPeriod ParamItem `refreshable:"true"`
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-07-07 14:32:21 +08:00
|
|
|
// io concurrency to fetch stats logs
|
2022-12-16 15:59:23 +08:00
|
|
|
IOConcurrency ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
|
|
|
|
2022-02-08 20:57:47 +08:00
|
|
|
func (p *dataNodeConfig) init(base *BaseTable) {
|
2022-12-07 18:01:19 +08:00
|
|
|
p.FlowGraphMaxQueueLength = ParamItem{
|
|
|
|
Key: "dataNode.dataSync.flowGraph.maxQueueLength",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1024",
|
|
|
|
}
|
|
|
|
p.FlowGraphMaxQueueLength.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.FlowGraphMaxParallelism = ParamItem{
|
|
|
|
Key: "dataNode.dataSync.flowGraph.maxParallelism",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1024",
|
|
|
|
}
|
|
|
|
p.FlowGraphMaxParallelism.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.FlushInsertBufferSize = ParamItem{
|
|
|
|
Key: "DATA_NODE_IBUFSIZE",
|
|
|
|
Version: "2.0.0",
|
|
|
|
FallbackKeys: []string{"datanode.segment.insertBufSize"},
|
|
|
|
DefaultValue: "16777216",
|
|
|
|
PanicIfEmpty: true,
|
2022-08-01 10:04:33 +08:00
|
|
|
}
|
2022-12-07 18:01:19 +08:00
|
|
|
p.FlushInsertBufferSize.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.FlushDeleteBufferBytes = ParamItem{
|
|
|
|
Key: "datanode.segment.deleteBufBytes",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "67108864",
|
|
|
|
}
|
|
|
|
p.FlushDeleteBufferBytes.Init(base.mgr)
|
2022-11-07 18:49:02 +08:00
|
|
|
|
2022-12-12 10:33:26 +08:00
|
|
|
p.BinLogMaxSize = ParamItem{
|
|
|
|
Key: "datanode.segment.binlog.maxsize",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "67108864",
|
|
|
|
}
|
|
|
|
p.BinLogMaxSize.Init(base.mgr)
|
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.SyncPeriod = ParamItem{
|
|
|
|
Key: "datanode.segment.syncPeriod",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "600",
|
|
|
|
}
|
|
|
|
p.SyncPeriod.Init(base.mgr)
|
2022-11-12 21:09:04 +08:00
|
|
|
|
2022-12-07 18:01:19 +08:00
|
|
|
p.IOConcurrency = ParamItem{
|
|
|
|
Key: "dataNode.dataSync.ioConcurrency",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "10",
|
|
|
|
}
|
|
|
|
p.IOConcurrency.Init(base.mgr)
|
2021-12-23 18:39:11 +08:00
|
|
|
|
2022-07-07 14:32:21 +08:00
|
|
|
}
|
|
|
|
|
2022-10-24 23:43:30 +08:00
|
|
|
// /////////////////////////////////////////////////////////////////////////////
|
2021-12-23 18:39:11 +08:00
|
|
|
// --- indexnode ---
|
|
|
|
type indexNodeConfig struct {
|
2022-12-16 15:59:23 +08:00
|
|
|
BuildParallel ParamItem `refreshable:"false"`
|
2022-09-21 20:16:51 +08:00
|
|
|
// enable disk
|
2022-12-16 15:59:23 +08:00
|
|
|
EnableDisk ParamItem `refreshable:"false"`
|
|
|
|
DiskCapacityLimit ParamItem `refreshable:"true"`
|
|
|
|
MaxDiskUsagePercentage ParamItem `refreshable:"true"`
|
2022-12-16 10:03:27 +08:00
|
|
|
|
2022-12-16 15:59:23 +08:00
|
|
|
GracefulStopTimeout ParamItem `refreshable:"false"`
|
2021-12-23 18:39:11 +08:00
|
|
|
}
|
|
|
|
|
2022-02-08 20:57:47 +08:00
|
|
|
func (p *indexNodeConfig) init(base *BaseTable) {
|
2022-12-07 18:01:19 +08:00
|
|
|
p.BuildParallel = ParamItem{
|
|
|
|
Key: "indexNode.scheduler.buildParallel",
|
|
|
|
Version: "2.0.0",
|
|
|
|
DefaultValue: "1",
|
|
|
|
}
|
|
|
|
p.BuildParallel.Init(base.mgr)
|
|
|
|
|
|
|
|
p.EnableDisk = ParamItem{
|
|
|
|
Key: "indexNode.enableDisk",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.EnableDisk.Init(base.mgr)
|
|
|
|
|
|
|
|
p.DiskCapacityLimit = ParamItem{
|
|
|
|
Key: "LOCAL_STORAGE_SIZE",
|
|
|
|
Version: "2.2.0",
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
if len(v) == 0 {
|
|
|
|
diskUsage, err := disk.Usage("/")
|
|
|
|
if err != nil {
|
|
|
|
panic(err)
|
|
|
|
}
|
|
|
|
return strconv.FormatUint(diskUsage.Total, 10)
|
|
|
|
}
|
|
|
|
diskSize := getAsInt64(v)
|
|
|
|
return strconv.FormatInt(diskSize*1024*1024*1024, 10)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.DiskCapacityLimit.Init(base.mgr)
|
|
|
|
|
|
|
|
p.MaxDiskUsagePercentage = ParamItem{
|
|
|
|
Key: "indexNode.maxDiskUsagePercentage",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "95",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
Formatter: func(v string) string {
|
|
|
|
return fmt.Sprintf("%f", getAsFloat(v)/100)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
p.MaxDiskUsagePercentage.Init(base.mgr)
|
2022-12-16 10:03:27 +08:00
|
|
|
|
|
|
|
p.GracefulStopTimeout = ParamItem{
|
|
|
|
Key: "indexNode.gracefulStopTimeout",
|
|
|
|
Version: "2.2.1",
|
|
|
|
FallbackKeys: []string{"common.gracefulStopTimeout"},
|
|
|
|
}
|
|
|
|
p.GracefulStopTimeout.Init(base.mgr)
|
2022-09-21 20:16:51 +08:00
|
|
|
}
|
2023-01-12 19:49:40 +08:00
|
|
|
|
|
|
|
type integrationTestConfig struct {
|
|
|
|
IntegrationMode ParamItem `refreshable:"false"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (p *integrationTestConfig) init(base *BaseTable) {
|
|
|
|
p.IntegrationMode = ParamItem{
|
|
|
|
Key: "integration.test.mode",
|
|
|
|
Version: "2.2.0",
|
|
|
|
DefaultValue: "false",
|
|
|
|
PanicIfEmpty: true,
|
|
|
|
}
|
|
|
|
p.IntegrationMode.Init(base.mgr)
|
|
|
|
}
|