Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Revert Expose metrics of stanby coordinators (#27698) #38742

Merged
merged 1 commit into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/datacoord/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@ func (s *Server) ShowConfigurations(ctx context.Context, req *internalpb.ShowCon
// it may include SystemMetrics, Topology metrics, etc.
func (s *Server) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
log := log.Ctx(ctx)
if err := merr.CheckHealthyStandby(s.GetStateCode()); err != nil {
if err := merr.CheckHealthy(s.GetStateCode()); err != nil {
return &milvuspb.GetMetricsResponse{
Status: merr.Status(err),
}, nil
Expand Down
2 changes: 1 addition & 1 deletion internal/querycoordv2/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ func (s *Server) GetMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest
log.RatedDebug(60, "get metrics request received",
zap.String("metricType", req.GetRequest()))

if err := merr.CheckHealthyStandby(s.State()); err != nil {
if err := merr.CheckHealthy(s.State()); err != nil {
msg := "failed to get metrics"
log.Warn(msg, zap.Error(err))
return &milvuspb.GetMetricsResponse{
Expand Down
2 changes: 1 addition & 1 deletion internal/rootcoord/root_coord.go
Original file line number Diff line number Diff line change
Expand Up @@ -1770,7 +1770,7 @@ func (c *Core) ShowConfigurations(ctx context.Context, req *internalpb.ShowConfi

// GetMetrics get metrics
func (c *Core) GetMetrics(ctx context.Context, in *milvuspb.GetMetricsRequest) (*milvuspb.GetMetricsResponse, error) {
if err := merr.CheckHealthyStandby(c.GetStateCode()); err != nil {
if err := merr.CheckHealthy(c.GetStateCode()); err != nil {
return &milvuspb.GetMetricsResponse{
Status: merr.Status(err),
Response: "",
Expand Down
12 changes: 0 additions & 12 deletions pkg/util/merr/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,6 @@ func CheckHealthy(state commonpb.StateCode) error {
return nil
}

// CheckHealthyStandby checks whether the state is healthy or standby,
// returns nil if healthy or standby
// otherwise returns ErrServiceNotReady wrapped with current state
// this method only used in GetMetrics
func CheckHealthyStandby(state commonpb.StateCode) error {
if state != commonpb.StateCode_Healthy && state != commonpb.StateCode_StandBy {
return WrapErrServiceNotReady(paramtable.GetRole(), paramtable.GetNodeID(), state.String())
}

return nil
}

func IsHealthy(stateCode commonpb.StateCode) error {
if stateCode == commonpb.StateCode_Healthy {
return nil
Expand Down
Loading