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

[Zen2] Add PeerFinder#onFoundPeersUpdated #32939

Merged

Conversation

DaveCTurner
Copy link
Contributor

Today the PeerFinder silently updates the set of found peers as new peers are
discovered and old ones are disconnected, and elections are scheduled
independently of these changes. In fact, it would be better if the election
scheduler were only activated on discovery of a quorum of peers. This commit
introduces the onFoundPeersUpdated method that allows this flow.

Today the PeerFinder silently updates the set of found peers as new peers are
discovered and old ones are disconnected, and elections are scheduled
independently of these changes. In fact, it would be better if the election
scheduler were only activated on discovery of a quorum of peers. This commit
introduces the `onFoundPeersUpdated` method that allows this flow.
@DaveCTurner DaveCTurner added >enhancement v7.0.0 :Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. labels Aug 17, 2018
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

@DaveCTurner
Copy link
Contributor Author

@elasticmachine retest this please

Copy link
Contributor

@ywelsch ywelsch left a comment

Choose a reason for hiding this comment

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

LGTM

for (final Peer peer : peersByAddress.values()) {
peer.handleWakeUp();
peersRemoved = peer.handleWakeUp() || peersRemoved;
Copy link
Contributor

Choose a reason for hiding this comment

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

another way to write this is to use |= (bit-wise or), see https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.22.2

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fun with non-strict || vs strict |. I'd prefer to leave as-is but will add a comment.

@DaveCTurner DaveCTurner merged commit e4ef127 into elastic:zen2 Aug 21, 2018
@ywelsch ywelsch mentioned this pull request Aug 21, 2018
61 tasks
@DaveCTurner DaveCTurner deleted the 2018-08-17-peerfinder-onFoundPeersUpdated branch July 23, 2022 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. >enhancement v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants