未验证 提交 d1b8c985 编写于 作者: N Nemo 提交者: GitHub

Fix a bug for standalone where it appears that DEPLOY_MODE is get/used before set. (#15712)

Signed-off-by: NYuchen Gao <yuchen.gao@zilliz.com>
上级 0527d111
......@@ -70,7 +70,7 @@ func stopRocksmq() {
rocksmq.CloseRocksMQ()
}
// MilvusRoles determines to run which components.
// MilvusRoles decides which components are brought up with Milvus.
type MilvusRoles struct {
EnableRootCoord bool `env:"ENABLE_ROOT_COORD"`
EnableProxy bool `env:"ENABLE_PROXY"`
......@@ -343,21 +343,14 @@ func (mr *MilvusRoles) runIndexNode(ctx context.Context, localMsg bool, alias st
// Run Milvus components.
func (mr *MilvusRoles) Run(local bool, alias string) {
if os.Getenv(metricsinfo.DeployModeEnvKey) == metricsinfo.StandaloneDeployMode {
closer := trace.InitTracing("standalone")
if closer != nil {
defer closer.Close()
}
}
ctx, cancel := context.WithCancel(context.Background())
// only standalone enable localMsg
if local {
Params.Init()
if err := os.Setenv(metricsinfo.DeployModeEnvKey, metricsinfo.StandaloneDeployMode); err != nil {
log.Error("Failed to set deploy mode: ", zap.Error(err))
}
Params.Init()
if err := initRocksmq(); err != nil {
panic(err)
......@@ -365,7 +358,7 @@ func (mr *MilvusRoles) Run(local bool, alias string) {
defer stopRocksmq()
if Params.EtcdCfg.UseEmbedEtcd {
// start etcd server
// Start etcd server.
etcd.InitEtcdServer(&Params.EtcdCfg)
defer etcd.StopEtcdServer()
}
......@@ -375,6 +368,13 @@ func (mr *MilvusRoles) Run(local bool, alias string) {
}
}
if os.Getenv(metricsinfo.DeployModeEnvKey) == metricsinfo.StandaloneDeployMode {
closer := trace.InitTracing("standalone")
if closer != nil {
defer closer.Close()
}
}
var rc *components.RootCoord
if mr.EnableRootCoord {
rc = mr.runRootCoord(ctx, local)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册