enhance: Set correct role for non-standalone deployment (#30303)

See also #30211

After fix initialization problem, distributed components do no have
their role set. This will cause logger & tracing miss component service
info when recording information.

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/30312/head
congqixia 2024-01-26 14:05:01 +08:00 committed by GitHub
parent e9fdd2475d
commit 20a3569c14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -128,6 +128,7 @@ func GetMilvusRoles(args []string, flags *flag.FlagSet) *roles.MilvusRoles {
serverType := args[2]
role := roles.NewMilvusRoles()
role.Alias = alias
role.ServerType = serverType
switch serverType {
case typeutil.RootCoordRole:
@ -166,7 +167,6 @@ func GetMilvusRoles(args []string, flags *flag.FlagSet) *roles.MilvusRoles {
role.EnableDataNode = enableDataNode
role.EnableIndexNode = enableIndexNode
role.EnableProxy = enableProxy
role.Mixture = true
default:
fmt.Fprintf(os.Stderr, "Unknown server type = %s\n%s", serverType, getHelp())
os.Exit(-1)

View File

@ -137,7 +137,8 @@ type MilvusRoles struct {
Local bool
Alias string
Embedded bool
Mixture bool
ServerType string
closed chan struct{}
once sync.Once
@ -334,9 +335,7 @@ func (mr *MilvusRoles) Run() {
log.Error("Failed to set deploy mode: ", zap.Error(err))
}
paramtable.Init()
if mr.Mixture {
paramtable.SetRole(typeutil.MixtureRole)
}
paramtable.SetRole(mr.ServerType)
}
expr.Init()