szetszwo commented on code in PR #794:
URL: https://github.com/apache/ratis/pull/794#discussion_r1037106723
##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -921,11 +921,11 @@ ReadRequests getReadRequests() {
}
private CompletableFuture<ReadIndexReplyProto> sendReadIndexAsync() {
- if (getInfo().getLeaderId() == null) {
- JavaUtils.completeExceptionally(generateNotLeaderException());
+ final RaftPeerId leaderId = getInfo().getLeaderId();
+ if (leaderId == null) {
+ return JavaUtils.completeExceptionally(generateNotLeaderException());
Review Comment:
You are right that NotLeaderException is incorrect -- this server could be a
follower and don't know who is the leader. It should not return
NotLeaderException in such case.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]