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

RATIS-1112. Ensure a node doesn't get reelected as a leader if it vol… #252

Merged
merged 2 commits into from
Nov 4, 2020
Merged

RATIS-1112. Ensure a node doesn't get reelected as a leader if it vol… #252

merged 2 commits into from
Nov 4, 2020

Conversation

szetszwo
Copy link
Contributor

@szetszwo szetszwo commented Nov 3, 2020

@@ -88,6 +93,20 @@ void stopRunning() {
this.isRunning = false;
}

boolean lostMajorityHeartbeats() {
Copy link
Contributor

@runzhiwang runzhiwang Nov 4, 2020

Choose a reason for hiding this comment

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

how about rename to isTimeoutSinceLostMajorityHeartbeats and return elapsed.compareTo(waitTime) >= 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I got that you wanted to invert the boolean. However, "isTimeoutSinceLostMajorityHeartbeats" is hard to understand. So, let's keep "lostMajorityHeartbeats"? Or I can change it to ""lostMajorityHeartbeatsRecently".

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, lostMajorityHeartbeatsRecently is better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@runzhiwang runzhiwang left a comment

Choose a reason for hiding this comment

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

LGTM

@szetszwo szetszwo merged commit 9357fdb into apache:master Nov 4, 2020
symious pushed a commit to symious/ratis that referenced this pull request Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants