fix: fix wrong log file name when running as mixture type (#29979)

See also: #25323, #29969
many users reported log file name is incorrect when starting in mixture
type.

---------

Signed-off-by: sunby <sunbingyi1992@gmail.com>
pull/30153/head
Bingyi Sun 2024-01-19 11:48:54 +08:00 committed by GitHub
parent 86f48861c1
commit dad27cbb40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View File

@ -13,10 +13,15 @@ import (
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/hardware"
"github.com/milvus-io/milvus/pkg/util/metricsinfo"
"github.com/milvus-io/milvus/pkg/util/paramtable"
)
type run struct{}
func init() {
paramtable.Init()
}
func (c *run) execute(args []string, flags *flag.FlagSet) {
if len(args) < 3 {
fmt.Fprintln(os.Stderr, getHelp())

View File

@ -24,6 +24,7 @@ import (
"github.com/milvus-io/milvus/pkg/log"
"github.com/milvus-io/milvus/pkg/util/etcd"
"github.com/milvus-io/milvus/pkg/util/hardware"
"github.com/milvus-io/milvus/pkg/util/paramtable"
"github.com/milvus-io/milvus/pkg/util/typeutil"
)
@ -171,6 +172,7 @@ func GetMilvusRoles(args []string, flags *flag.FlagSet) *roles.MilvusRoles {
os.Exit(-1)
}
paramtable.SetRole(serverType)
return role
}

View File

@ -103,11 +103,6 @@ func runComponent[T component](ctx context.Context,
factory := dependency.NewFactory(localMsg)
var err error
role, err = creator(ctx, factory)
if localMsg {
paramtable.SetRole(typeutil.StandaloneRole)
} else {
paramtable.SetRole(role.GetName())
}
if err != nil {
panic(err)
}