hanishakoneru commented on a change in pull request #89:
URL: https://github.com/apache/incubator-ratis/pull/89#discussion_r422393757



##########
File path: 
ratis-server/src/main/java/org/apache/ratis/server/raftlog/RaftLog.java
##########
@@ -313,11 +338,15 @@ protected void validateLogEntry(LogEntryProto entry) {
     }
     TermIndex lastTermIndex = getLastEntryTermIndex();
     if (lastTermIndex != null) {
+      long latestSnapshotIndex = getSnapshotIndex();
+      long lastIndex = lastTermIndex.getIndex() > latestSnapshotIndex ?
+          lastTermIndex.getIndex() : latestSnapshotIndex;

Review comment:
       Added a check to be on safe side.




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


Reply via email to