Update DataNode state before stop (#12946)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
This commit is contained in:
congqixia 2021-12-08 14:19:04 +08:00 committed by GitHub
parent 214f40b209
commit 1195f441b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}