Skip to content

receiver don't need to get itself when healthCheck #6515

@xuanyu66

Description

@xuanyu66

Please answer these questions before submitting your issue.

  • Why do you submit this issue?
  • Question or discussion

Question

  • What do you want to know?
    If OapNode‘s role is receiver, the OAPNodeChecker'method isHealth() will return unHealth.
 public static ClusterHealthStatus isHealth(List<RemoteInstance> remoteInstances) {
        if (CollectionUtils.isEmpty(remoteInstances)) {
            return ClusterHealthStatus.unHealth("can't get the instance list");
        }
        List<RemoteInstance> selfInstances = remoteInstances.stream().
                filter(remoteInstance -> remoteInstance.getAddress().isSelf()).collect(Collectors.toList());
        if (CollectionUtils.isEmpty(selfInstances)) {
            return ClusterHealthStatus.unHealth("can't get itself");
        }
        if (remoteInstances.size() > 1 && hasIllegalNodeAddress(remoteInstances)) {
            return ClusterHealthStatus.unHealth("find illegal node in cluster mode such as 127.0.0.1, localhost");
        }
        return ClusterHealthStatus.HEALTH;
    }

I think OAPNodeChecker should check its role and then decide whether to get itself.
But how can I get role?

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendOAP backend related.bugSomething isn't working and you are sure it's a bug!so11ySelf Observability

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions