Skip to content
Snippets Groups Projects
Commit 3f45cfd6 authored by neza2017's avatar neza2017 Committed by yefu.chen
Browse files

Fix data node


Signed-off-by: default avatarneza2017 <yefu.chen@zilliz.com>
parent 675426ea
No related branches found
No related tags found
No related merge requests found
......@@ -56,6 +56,7 @@ type (
DataNode struct {
ctx context.Context
cancel context.CancelFunc
NodeID UniqueID
Role string
State internalpb2.StateCode
......@@ -77,8 +78,10 @@ type (
func NewDataNode(ctx context.Context) *DataNode {
Params.Init()
ctx2, cancel2 := context.WithCancel(ctx)
node := &DataNode{
ctx: ctx,
ctx: ctx2,
cancel: cancel2,
NodeID: Params.NodeID, // GOOSE TODO How to init
Role: typeutil.DataNodeRole,
State: internalpb2.StateCode_INITIALIZING,
......@@ -216,7 +219,7 @@ func (node *DataNode) FlushSegments(in *datapb.FlushSegRequest) error {
}
func (node *DataNode) Stop() error {
<-node.ctx.Done()
node.cancel()
// close services
if node.dataSyncService != nil {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment