szetszwo commented on a change in pull request #383:
URL: https://github.com/apache/incubator-ratis/pull/383#discussion_r551924473
##########
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:
Sorry that I was not clear. By "user", I actually mean RaftClient.
RaftServerImpl.checkLeaderState is an internal private method. It is called by
all the leader methods such as submitClientRequestAsync(..). RaftClient will
get a NotLeaderException when isLeader() returns false, or
LeaderNotReadyException when isLeaderReady() returns false.
If the leader is not going to step down, it is better to change
isLeaderReady(). The leader may regain the leader lease so that RaftClient
should retry with the same leader.
----------------------------------------------------------------
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]