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


##########
ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerImpl.java:
##########
@@ -1825,6 +1828,11 @@ CompletableFuture<Message> 
applyLogToStateMachine(LogEntryProto next) throws Raf
     return null;
   }
 
+  boolean isFirstLogAppliedByCurrentLeaderInCurrentTerm(long term) {
+    return term != state.getLastEntry().getTerm()

Review Comment:
   Thanks for the patch! I guess you are trying to compare the term of the 
_current applying log_ with the _last applied log_ to decide the very first log 
of the current leader. However, `state.getLastEntry().getTerm()` returns the 
last **committed** log's term, not the last **applied** log's term. 



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