avijayanhwx commented on a change in pull request #322:
URL: https://github.com/apache/incubator-ratis/pull/322#discussion_r536830266



##########
File path: 
ratis-server/src/main/java/org/apache/ratis/server/raftlog/RaftLog.java
##########
@@ -359,6 +365,9 @@ protected void validateLogEntry(LogEntryProto entry) {
               "is greater than 1, entry: %s",
           lastTermIndex.getIndex(), latestSnapshotIndex, entry);
     } else {
+      // No logs are present. Check state machine's snapshot index.
+      updateSnapshotIndex(snapshotIndexSupplier.getAsLong());
+      latestSnapshotIndex = getSnapshotIndex();

Review comment:
       A good point. But we don't expect it to be called for every validate 
call since it is in updated only in the case when there are no logs. That can 
happen only once after every purge. But, I agree we can move this to purge.




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