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

Feature/410/expose raft cluster api #501

Merged
merged 6 commits into from
Sep 11, 2018

Conversation

apratt3377
Copy link
Contributor

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

@jpmsam jpmsam requested review from bts and joelburget August 22, 2018 16:08
Copy link
Contributor

@bts bts left a 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.

internal/web3ext/web3ext.go Show resolved Hide resolved
Copy link
Contributor

@bts bts left a 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)
Copy link
Contributor

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:

https://github.com/jpmorganchase/quorum/blob/d71daf324590d0033d0fc0ad255cadb702cf2b3b/raft/handler.go#L184-L219

@bts
Copy link
Contributor

bts commented Sep 11, 2018

@apratt3377 thanks!

@jpmsam ready to go

@jpmsam jpmsam merged commit 0af7ad0 into Consensys:master Sep 11, 2018
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.

3 participants