hanishakoneru commented on a change in pull request #89:
URL: https://github.com/apache/incubator-ratis/pull/89#discussion_r422377549
##########
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:
If a snapshot installation is in progress, append log entries would
fail. RaftServerImpl#checkInconsistentAppendEntries() takes care of this. So
even though the above scenario is possible, it will be taken care of before it
reached RaftLog#validateLogEntry().
----------------------------------------------------------------
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]