-
Notifications
You must be signed in to change notification settings - Fork 11
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
Report own_peer address in HealthCheck method #48
Conversation
c9861ff
to
7d28304
Compare
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
Thanks for your feedback. I totally agreed with your suggestions. Will update the PR. |
646e476
to
1c64178
Compare
1c64178
to
5e8a7bd
Compare
@thrawn01 , given the recent changes, shall we cut a minor release, |
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
andAdvertise_Address
, a misconfiguration could lead the node fail to identify itself before callingSetPeers
. 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.