-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Feature/410/expose raft cluster api #501
Feature/410/expose raft cluster api #501
Conversation
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.
This looks good generally, but it seems that we should probably include the Address
for the current/reporting node alongside those of its peers.
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.
I think we're really close -- can you make this one additional tweak? Thank you!
raft/api.go
Outdated
|
||
func (s *PublicRaftAPI) Cluster() []*Address { | ||
return append(s.raftService.raftProtocolManager.NodeInfo().PeerAddresses, | ||
s.raftService.raftProtocolManager.NodeInfo().Address) |
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.
Can you extract s.raftService.raftProtocolManager.NodeInfo()
to a local variable, and then reuse that value for accessing both PeerAddresses
and Address
? This is because NodeInfo()
takes a lock and does a bunch of work:
@apratt3377 thanks! @jpmsam ready to go |
Give users the ability to see raft cluster information. raft.cluster exposes info of all the peers in the cluster (in pm.peers) including the raftId, nodeId, ip address, raft port, p2p port. This can be used to check that all raft nodes came up that were expected. Also can be used along with admin.peers to make sure the network was configured properly