From 1195f441b295df70e8352461ece792ce0a13bcdd Mon Sep 17 00:00:00 2001 From: congqixia Date: Wed, 8 Dec 2021 14:19:04 +0800 Subject: [PATCH] Update DataNode state before stop (#12946) Signed-off-by: Congqi Xia --- internal/datanode/data_node.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/datanode/data_node.go b/internal/datanode/data_node.go index f7b656aa7f..1eea5f983a 100644 --- a/internal/datanode/data_node.go +++ b/internal/datanode/data_node.go @@ -626,6 +626,9 @@ func (node *DataNode) FlushSegments(ctx context.Context, req *datapb.FlushSegmen // Stop will release DataNode resources and shutdown datanode func (node *DataNode) Stop() error { + // https://github.com/milvus-io/milvus/issues/12282 + node.UpdateStateCode(internalpb.StateCode_Abnormal) + node.cancel() node.chanMut.RLock() @@ -646,9 +649,6 @@ func (node *DataNode) Stop() error { node.session.Revoke(time.Second) - // https://github.com/milvus-io/milvus/issues/12282 - node.UpdateStateCode(internalpb.StateCode_Abnormal) - return nil }