Skip to content

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 Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. labels Aug 17, 2018
@DaveCTurner DaveCTurner requested a review from ywelsch August 17, 2018 11:28
@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 Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. >enhancement v7.0.0-beta1
4 participants