hanishakoneru commented on a change in pull request #89:
URL: https://github.com/apache/incubator-ratis/pull/89#discussion_r421774542
##########
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:
So the case when snapshotIndex is greater than entry but there is no
lastTermIndex?
This would mean that follower has conveyed the wrong snapshotIndex/
nextIndex to the leader.
I can add a check in validateLogEntry for this scenario but the problem
would be bigger if this could happen, right?
----------------------------------------------------------------
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]