SzyWilliam commented on code in PR #700:
URL: https://github.com/apache/ratis/pull/700#discussion_r936650328


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -893,6 +893,14 @@ private CompletableFuture<RaftClientReply> 
staleReadAsync(RaftClientRequest requ
     return processQueryFuture(stateMachine.queryStale(request.getMessage(), 
minIndex), request);
   }
 
+  private CompletableFuture<RaftClientReply> readOnlyAsync(RaftClientRequest 
request) {
+    LeaderState leaderState = role.getLeaderStateNonNull();
+    return leaderState.getReadIndex()

Review Comment:
   If the server is a follower, it should first send RPC to leader to obtain 
leader's `readindex`. Leader should also do the heartbeats to confirm 
leadership. After follower get the current `readindex`, it simply waits for 
statemachine to advance and query. I plan to implement follower linearizable 
read in next PR.



-- 
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]

Reply via email to