Fix bug: refresh config after session init (#14194)

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
zhenshan.cao 2021-12-24 22:22:17 +08:00 committed by GitHub
parent a3942571c4
commit 9a2c91d326
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 9 deletions

View File

@ -209,11 +209,8 @@ func (node *DataNode) Init() error {
log.Error("DataNode init session failed", zap.Error(err))
return err
}
Params.DataNodeCfg.Refresh()
// TODO: caiyd need check
//Params.initMsgChannelSubName()
//TODO reset
//Params.initLogCfg()
log.Debug("DataNode Init",
zap.String("MsgChannelSubName", Params.DataNodeCfg.MsgChannelSubName),
)

View File

@ -142,8 +142,7 @@ func (node *Proxy) Init() error {
log.Error("Proxy init session failed", zap.Error(err))
return err
}
// TODO: caiyd need check
//Params.initProxySubName()
Params.ProxyCfg.Refresh()
// wait for datacoord state changed to Healthy
if node.dataCoord != nil {
log.Debug("Proxy wait for DataCoord ready")

View File

@ -186,6 +186,7 @@ func (node *QueryNode) Init() error {
initError = err
return
}
Params.QueryNodeCfg.Refresh()
connectEtcdFn := func() error {
etcdKV, err := etcdkv.NewEtcdKV(Params.QueryNodeCfg.EtcdEndpoints, Params.QueryNodeCfg.MetaRootPath)
if err != nil {
@ -253,9 +254,6 @@ func (node *QueryNode) Init() error {
zap.Any("IP", Params.QueryNodeCfg.QueryNodeIP),
zap.Any("Port", Params.QueryNodeCfg.QueryNodePort),
)
// This param needs valid QueryNodeID
//Params.initMsgChannelSubName()
// TODO: caiyd need check
})
return initError

View File

@ -541,6 +541,11 @@ func (p *proxyConfig) init(bp *BaseParamTable) {
//p.initRoleName()
}
// Refresh is called after session init
func (p *proxyConfig) Refresh() {
p.initProxySubName()
}
// InitAlias initialize Alias member.
func (p *proxyConfig) InitAlias(alias string) {
p.Alias = alias
@ -1101,6 +1106,11 @@ func (p *queryNodeConfig) InitAlias(alias string) {
p.Alias = alias
}
// Refresh is called after session init
func (p *queryNodeConfig) Refresh() {
p.initMsgChannelSubName()
}
func (p *queryNodeConfig) initCacheSize() {
defer log.Debug("init cacheSize", zap.Any("cacheSize (GB)", p.CacheSize))
@ -1725,6 +1735,11 @@ func (p *dataNodeConfig) init(bp *BaseParamTable) {
//p.initRoleName()
}
// Refresh is called after session init
func (p *dataNodeConfig) Refresh() {
p.initMsgChannelSubName()
}
// InitAlias init this DataNode alias
func (p *dataNodeConfig) InitAlias(alias string) {
p.Alias = alias