-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[Zen2] Introduce gossip-like discovery of master nodes #32246
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit
Hold shift + click to select a range
aaa8753
Introduce gossip-like discovery of master nodes
DaveCTurner 321def8
No zen2 in request peers action
DaveCTurner 8e9c881
Fix up discovery.find_peers_interval setting
DaveCTurner c870c94
Remove unused foundQuorumFrom
DaveCTurner 686a434
protected
DaveCTurner 83f7189
Inline one-use method
DaveCTurner 1525607
We do not probe the local address so it does not need to be provided
DaveCTurner 0b4e9d1
Fixup protected
DaveCTurner d524a62
Remove labelRunnable() and use an AbstractRunnable
DaveCTurner 93ce793
Just created this, don't need another copy
DaveCTurner 38ef542
Rename
DaveCTurner 578a57f
Rename
DaveCTurner 6ec315c
Not so private
DaveCTurner a933a7f
TODOs
DaveCTurner dddeecd
Renaming
DaveCTurner 2177d0a
lastAcceptedNodes cannot change while the peerfinder is active, so ju…
DaveCTurner 320ebdd
Do not need the local node to be in foundPeers, so remove it
DaveCTurner 3712208
Rename discoveryNodes -> knownPeers in PeersRequest
DaveCTurner a566ffc
Rename candidateNodes to knownPeers in PeersResponse too
DaveCTurner 5f12c03
Imports
DaveCTurner dcfa1ca
Private class
DaveCTurner 53c1dff
Private
DaveCTurner 0120029
Add assertion of received term
DaveCTurner 3fab139
Start work on having the PeerFinder respond to PeersRequests directly
DaveCTurner 4701d35
Fix assertion
DaveCTurner 4b70b2e
Add test case for values in PeersResponse
DaveCTurner ffe6637
Test that it does delegate to onPeersRequestWhenInactive if inactive
DaveCTurner b219998
Also verify that it receives messages from the transport service
DaveCTurner 52834a1
TODO resolved
DaveCTurner 354c94e
Imports
DaveCTurner 94cf9a3
Remove foundPeers and just track the nodes we've sent requests to
DaveCTurner c7bcae9
Prevent multiple concurrent attempts to connect to the same node
DaveCTurner 7d2a5a6
Merge branch 'zen2' into 2018-07-20-peerfinder
DaveCTurner 9e156df
Line length
DaveCTurner c805add
Remove unused class
DaveCTurner 7aec464
Remove refs to probeLock
DaveCTurner 33b17ce
connectTo is already async, no need to schedule it with the executorS…
DaveCTurner b00795c
Consolidate per-address logic into Peer class
DaveCTurner 0e9850e
No need to track separate state, just need a boolean
DaveCTurner f466b44
Tweaks
DaveCTurner 3c219de
Need moar coffee
DaveCTurner 9356a26
Pass in leader when deactivating
DaveCTurner 7afe75c
Remove comments re. synchronisation
DaveCTurner 27e95cf
Rename callback
DaveCTurner 5374f2b
Remove foundMasterNode boolean
DaveCTurner 1308444
Assert discoveryNode not set
DaveCTurner b7c598b
Get the remote node again rather than passing it in
DaveCTurner 417e6e2
Unwrap provided addresses
DaveCTurner 4ca2e62
Extract ConfiguredHostsResolver class
DaveCTurner f034f18
Combine ActivePeerFinder and PeerFinder
DaveCTurner 380d930
No need to expose isActive - this test is not helpful
DaveCTurner 34b6fd4
Assert lifecycle is started
DaveCTurner 98cd79a
No need for PeerFinder to be responsible for lifecycle of ConfiguredH…
DaveCTurner e3f9638
Add another test with failing address resolution
DaveCTurner 253e2ea
Delete unused class
DaveCTurner 5d97de7
Fix log message
DaveCTurner fb171e7
Assert no known peers as soon as deactivated
DaveCTurner 8126e86
Private
DaveCTurner 01e230f
Inline and rename
DaveCTurner 8e3b175
Use AbstractRunnable and force execution
DaveCTurner 4c52e50
Nullable
DaveCTurner 121aad3
Rename and streamify
DaveCTurner c07c7d4
Reorder method
DaveCTurner 1d4adcc
Rename request peers action
DaveCTurner f0e7155
Safe to wake up peers even if already deactivated
DaveCTurner c19b3df
Imports
DaveCTurner 2051db6
Fix log message
DaveCTurner 221253a
Oneliners
DaveCTurner e5414a1
Add discoveryNode to PeersFinder.Peer.toString() and remove from log …
DaveCTurner 3608505
Remove TODO
DaveCTurner 2013f10
Move PeerFinder machinery to discovery package
DaveCTurner 8b605ad
Move ConfiguredHostsResolver interface into PeerFinder
DaveCTurner 9aa9003
Logger usage
DaveCTurner b517ce9
Whitespace
DaveCTurner 253a994
No need to refer to class name in log messages
DaveCTurner 7948268
Can only deactivate an active PeerFinder
DaveCTurner b4df5f3
Revert "Can only deactivate an active PeerFinder"
DaveCTurner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
assert active == false?
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.
The tests deactivate the
PeerFinderat the end, regardless of whether it's active or not, and there's no particular reason to avoid double-deactivation or to make sure that each test ends with an activePeerFinder.Also although I am pretty sure that we can't change the leader without being active, this is not something we guarantee, nor do I think we need to.