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

Report own_peer address in HealthCheck method #48

Merged
merged 1 commit into from
Jan 10, 2025

Conversation

huikang
Copy link
Contributor

@huikang huikang commented Jan 10, 2025

  • Why we need the new field in message HealthCheckResp

My understanding is that each instance in the gubernator cluster advertises an address to let peers find itself. This adverse address is included in a slice of PeerInfo. The instance must identify its own address in the PeerInfo slice.
However, since each instance may have two addresses GRPC_ADDRESS and Advertise_Address , a misconfiguration could lead the node fail to identify itself before calling SetPeers . Therefore, when we check the status of the cluster, it's helpful to know each peer has identified itself in the cluster by checking the list of peers.

This new field own_peer uses the adverse_address of the instance to match the address in the known peers.
If the instance doesn't identify itself in the peer list, the own_peer is empty, which may indicate there is some misconfiguration of the node.

Please correct me if my understanding is wrong. Thanks.

@huikang huikang requested a review from Baliedge as a code owner January 10, 2025 15:23
@huikang huikang force-pushed the hk/health-check-owner-ip branch from c9861ff to 7d28304 Compare January 10, 2025 16:09
Copy link
Collaborator

@thrawn01 thrawn01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this PR!

own_peer could be confusing without knowledge of the code and understanding what "own" or "owner" means in this context.

I suggest calling it advertise_address as that is slightly less confusing. 😄

I also suggested adding more detailed to the comment in order to clarify the intent of the new field.

gubernator.go Outdated
@@ -576,6 +586,8 @@ func (s *V1Instance) HealthCheck(ctx context.Context, r *HealthCheckReq) (health
health.Message = strings.Join(errs, "|")
}

health.OwnPeer = ownPeerAddress
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this address is empty, then we should set health.Status = UnHealthy

@huikang
Copy link
Contributor Author

huikang commented Jan 10, 2025

Thank you for this PR!

own_peer could be confusing without knowledge of the code and understanding what "own" or "owner" means in this context.

I suggest calling it advertise_address as that is slightly less confusing. 😄

I also suggested adding more detailed to the comment in order to clarify the intent of the new field.

Thanks for your feedback. I totally agreed with your suggestions. Will update the PR.

@huikang huikang force-pushed the hk/health-check-owner-ip branch from 646e476 to 1c64178 Compare January 10, 2025 16:48
@huikang huikang force-pushed the hk/health-check-owner-ip branch from 1c64178 to 5e8a7bd Compare January 10, 2025 17:01
@thrawn01 thrawn01 merged commit 08aa9b9 into gubernator-io:master Jan 10, 2025
4 checks passed
@huikang
Copy link
Contributor Author

huikang commented Jan 13, 2025

@thrawn01 , given the recent changes, shall we cut a minor release, 2.10.1?

@thrawn01
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants