runzhiwang commented on a change in pull request #383:
URL: https://github.com/apache/incubator-ratis/pull/383#discussion_r551906792
##########
File path:
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java
##########
@@ -104,6 +104,20 @@ public RaftPeerRole getCurrentRole() {
return getRole().getCurrentRole();
}
+ @Override
+ public boolean isLeader() {
Review comment:
> Assume that the leader won't step down if it has lost the leader lease.
@szetszwo Yes, leader won't step down if it has lost the leader lease.
Because I'm afraid if step down, leader election will happen more frequent.
If not step down, leader lost the lease maybe can get the lease again in
future. If leader actully need to step down, we do achieve it by
checkLeaderShip, so there is a buffer time between lost lease and step down for
leader to get lease again. Step down or not, I think it's still under
discussion.
> If we change isLeader(), the client will see NotLeaderException and retry
with a different peer.
Yes, but user maybe prefer to call isLeader, maybe retry with a different
peer does not matter ? not sure.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]