avijayanhwx opened a new pull request #322: URL: https://github.com/apache/incubator-ratis/pull/322
## What changes were proposed in this pull request? After a log purge is done to the last log index, RaftLog#getLastEntryTermIndex will return a null. In RaftLog#validateLogEntry, when the last term index is null, the expectation is that the new entry to be appended is lastSnapshotIndex + 1. However, the 'lastSnapshotIndex' in RaftLog is updated only through installSnapshot calls. Hence, the validation fails and all further appends will fail until a restart. This patch uses a simple fallback in the RaftLog to ask the state machine for the snapshot index, when there is no logs available. ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/RATIS-1195 ## How was this patch tested? Manually tested. ---------------------------------------------------------------- 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]
