Update indexnode state to unhealthy before stopping (#12744)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/12678/head
congqixia 2021-12-06 10:39:36 +08:00 committed by GitHub
parent 19000e6af2
commit 38956215aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -215,6 +215,9 @@ func (i *IndexNode) Start() error {
// Stop closes the server. // Stop closes the server.
func (i *IndexNode) Stop() error { func (i *IndexNode) Stop() error {
// https://github.com/milvus-io/milvus/issues/12282
i.UpdateStateCode(internalpb.StateCode_Abnormal)
i.loopCancel() i.loopCancel()
if i.sched != nil { if i.sched != nil {
i.sched.Close() i.sched.Close()
@ -224,9 +227,6 @@ func (i *IndexNode) Stop() error {
} }
i.session.Revoke(time.Second) i.session.Revoke(time.Second)
// https://github.com/milvus-io/milvus/issues/12282
i.UpdateStateCode(internalpb.StateCode_Abnormal)
log.Debug("Index node stopped.") log.Debug("Index node stopped.")
return nil return nil
} }