From 38956215aa68fe81daaa85f16ff2da8df93faade Mon Sep 17 00:00:00 2001 From: congqixia Date: Mon, 6 Dec 2021 10:39:36 +0800 Subject: [PATCH] Update indexnode state to unhealthy before stopping (#12744) Signed-off-by: Congqi Xia --- internal/indexnode/indexnode.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/indexnode/indexnode.go b/internal/indexnode/indexnode.go index 0d42120f8f..4694157987 100644 --- a/internal/indexnode/indexnode.go +++ b/internal/indexnode/indexnode.go @@ -215,6 +215,9 @@ func (i *IndexNode) Start() error { // Stop closes the server. func (i *IndexNode) Stop() error { + // https://github.com/milvus-io/milvus/issues/12282 + i.UpdateStateCode(internalpb.StateCode_Abnormal) + i.loopCancel() if i.sched != nil { i.sched.Close() @@ -224,9 +227,6 @@ func (i *IndexNode) Stop() error { } i.session.Revoke(time.Second) - // https://github.com/milvus-io/milvus/issues/12282 - i.UpdateStateCode(internalpb.StateCode_Abnormal) - log.Debug("Index node stopped.") return nil }