From c4f4ae8627666f63331dcf9e7233e841624fbf71 Mon Sep 17 00:00:00 2001 From: neza2017 Date: Tue, 26 Jan 2021 17:47:38 +0800 Subject: [PATCH] Fix master Signed-off-by: neza2017 --- cmd/datanode/main.go | 2 ++ internal/masterservice/master_service.go | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/cmd/datanode/main.go b/cmd/datanode/main.go index 732a8cbb1..f20802305 100644 --- a/cmd/datanode/main.go +++ b/cmd/datanode/main.go @@ -12,6 +12,7 @@ import ( dnc "github.com/zilliztech/milvus-distributed/internal/distributed/datanode" dsc "github.com/zilliztech/milvus-distributed/internal/distributed/dataservice" msc "github.com/zilliztech/milvus-distributed/internal/distributed/masterservice" + ms "github.com/zilliztech/milvus-distributed/internal/masterservice" "github.com/zilliztech/milvus-distributed/internal/proto/commonpb" "github.com/zilliztech/milvus-distributed/internal/proto/internalpb2" ) @@ -32,6 +33,7 @@ func main() { log.Println("Datanode is", dn.Params.NodeID) // --- Master Service Client --- + ms.Params.Init() log.Println("Master service address:", dn.Params.MasterAddress) masterClient, err := msc.NewGrpcClient(dn.Params.MasterAddress, 20*time.Second) if err != nil { diff --git a/internal/masterservice/master_service.go b/internal/masterservice/master_service.go index 11841cbb8..c15d476cc 100644 --- a/internal/masterservice/master_service.go +++ b/internal/masterservice/master_service.go @@ -717,6 +717,18 @@ func (c *Core) GetComponentStates() (*internalpb2.ComponentStates, error) { StateCode: code, ExtraInfo: nil, }, + Status: &commonpb.Status{ + ErrorCode: commonpb.ErrorCode_SUCCESS, + Reason: "", + }, + SubcomponentStates: []*internalpb2.ComponentInfo{ + { + NodeID: int64(Params.NodeID), + Role: typeutil.MasterServiceRole, + StateCode: code, + ExtraInfo: nil, + }, + }, }, nil } -- GitLab