diff --git a/internal/datacoord/services.go b/internal/datacoord/services.go index cda58e6c8d..16794f88c4 100644 --- a/internal/datacoord/services.go +++ b/internal/datacoord/services.go @@ -619,6 +619,7 @@ func (s *Server) GetStateCode() commonpb.StateCode { // GetComponentStates returns DataCoord's current state func (s *Server) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error) { code := s.GetStateCode() + log.Debug("DataCoord current state", zap.String("StateCode", code.String())) nodeID := common.NotRegisteredID if s.session != nil && s.session.Registered() { nodeID = s.session.GetServerID() // or Params.NodeID diff --git a/internal/datanode/services.go b/internal/datanode/services.go index f3c6d918dc..8d71c0b7f5 100644 --- a/internal/datanode/services.go +++ b/internal/datanode/services.go @@ -67,8 +67,9 @@ func (node *DataNode) WatchDmChannels(ctx context.Context, in *datapb.WatchDmCha // GetComponentStates will return current state of DataNode func (node *DataNode) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error) { - log.Debug("DataNode current state", zap.Any("State", node.stateCode.Load())) nodeID := common.NotRegisteredID + state := node.stateCode.Load().(commonpb.StateCode) + log.Debug("DataNode current state", zap.String("State", state.String())) if node.GetSession() != nil && node.session.Registered() { nodeID = node.GetSession().ServerID } diff --git a/internal/distributed/datacoord/client/client.go b/internal/distributed/datacoord/client/client.go index d24b17e7e7..111868369a 100644 --- a/internal/distributed/datacoord/client/client.go +++ b/internal/distributed/datacoord/client/client.go @@ -87,7 +87,10 @@ func (c *Client) getDataCoordAddr() (string, error) { log.Debug("DataCoordClient, not existed in msess ", zap.Any("key", key), zap.Any("len of msess", len(msess))) return "", fmt.Errorf("find no available datacoord, check datacoord state") } - + log.Debug("DataCoordClient GetSessions success", + zap.String("address", ms.Address), + zap.Int64("serverID", ms.ServerID), + ) c.grpcClient.SetNodeID(ms.ServerID) return ms.Address, nil } diff --git a/internal/distributed/querycoord/client/client.go b/internal/distributed/querycoord/client/client.go index ac1e78e202..80c789d63f 100644 --- a/internal/distributed/querycoord/client/client.go +++ b/internal/distributed/querycoord/client/client.go @@ -77,6 +77,11 @@ func (c *Client) getQueryCoordAddr() (string, error) { log.Debug("QueryCoordClient msess key not existed", zap.Any("key", key)) return "", fmt.Errorf("find no available querycoord, check querycoord state") } + + log.Debug("QueryCoordClient GetSessions success", + zap.String("address", ms.Address), + zap.Int64("serverID", ms.ServerID), + ) c.grpcClient.SetNodeID(ms.ServerID) return ms.Address, nil } diff --git a/internal/proxy/impl.go b/internal/proxy/impl.go index 095832e476..69a1006ba7 100644 --- a/internal/proxy/impl.go +++ b/internal/proxy/impl.go @@ -69,6 +69,7 @@ func (node *Proxy) GetComponentStates(ctx context.Context, req *milvuspb.GetComp Status: merr.Success(), } code := node.GetStateCode() + log.Debug("Proxy current state", zap.String("StateCode", code.String())) nodeID := common.NotRegisteredID if node.session != nil && node.session.Registered() { nodeID = node.session.ServerID diff --git a/internal/querycoordv2/server.go b/internal/querycoordv2/server.go index 9035123289..fbd3910604 100644 --- a/internal/querycoordv2/server.go +++ b/internal/querycoordv2/server.go @@ -531,6 +531,7 @@ func (s *Server) State() commonpb.StateCode { } func (s *Server) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error) { + log.Debug("QueryCoord current state", zap.String("StateCode", s.State().String())) nodeID := common.NotRegisteredID if s.session != nil && s.session.Registered() { nodeID = s.session.GetServerID() diff --git a/internal/querynodev2/services.go b/internal/querynodev2/services.go index 77771a6f63..56929df953 100644 --- a/internal/querynodev2/services.go +++ b/internal/querynodev2/services.go @@ -64,6 +64,8 @@ func (node *QueryNode) GetComponentStates(ctx context.Context, req *milvuspb.Get code := node.lifetime.GetState() nodeID := common.NotRegisteredID + log.Debug("QueryNode current state", zap.Int64("NodeID", nodeID), zap.String("StateCode", code.String())) + if node.session != nil && node.session.Registered() { nodeID = paramtable.GetNodeID() } diff --git a/internal/rootcoord/root_coord.go b/internal/rootcoord/root_coord.go index 6b4f62641d..86c59cd7b8 100644 --- a/internal/rootcoord/root_coord.go +++ b/internal/rootcoord/root_coord.go @@ -759,6 +759,7 @@ func (c *Core) Stop() error { // GetComponentStates get states of components func (c *Core) GetComponentStates(ctx context.Context, req *milvuspb.GetComponentStatesRequest) (*milvuspb.ComponentStates, error) { code := c.GetStateCode() + log.Debug("RootCoord current state", zap.String("StateCode", code.String())) nodeID := common.NotRegisteredID if c.session != nil && c.session.Registered() { diff --git a/internal/util/componentutil/componentutil.go b/internal/util/componentutil/componentutil.go index 96b74732d1..93537d2445 100644 --- a/internal/util/componentutil/componentutil.go +++ b/internal/util/componentutil/componentutil.go @@ -21,10 +21,12 @@ import ( "fmt" "time" + "go.uber.org/zap" "google.golang.org/grpc" "github.com/milvus-io/milvus-proto/go-api/v2/commonpb" "github.com/milvus-io/milvus-proto/go-api/v2/milvuspb" + "github.com/milvus-io/milvus/pkg/log" "github.com/milvus-io/milvus/pkg/util/merr" "github.com/milvus-io/milvus/pkg/util/retry" ) @@ -56,6 +58,7 @@ func WaitForComponentStates[T interface { serviceName, resp.State.StateCode.String()) } + log.Info("WaitForComponentStates success", zap.String("current state", resp.State.StateCode.String())) return nil } return retry.Do(ctx, checkFunc, retry.Attempts(attempts), retry.Sleep(sleep)) diff --git a/internal/util/dependency/kv/kv_client_handler.go b/internal/util/dependency/kv/kv_client_handler.go index 77935d9509..40b013849c 100644 --- a/internal/util/dependency/kv/kv_client_handler.go +++ b/internal/util/dependency/kv/kv_client_handler.go @@ -46,7 +46,7 @@ func CloseEtcdClient() { func getEtcdAndPath() (*clientv3.Client, string) { clientCreator.mu.Lock() defer clientCreator.mu.Unlock() - // If client/path doesnt exist, create a new one + // If client/path doesn’t exist, create a new one if clientCreator.client == nil { var err error clientCreator.client, err = createEtcdClient()