avijayanhwx opened a new pull request #360: URL: https://github.com/apache/incubator-ratis/pull/360
## What changes were proposed in this pull request? **Steps to reproduce issue** - Setup a 3 node ratis group. - Write some transactions into the quorum. - Bring 1 peer down. - Write more transactions into the quorum (other 2 nodes), take a snapshot at the last txn and purge logs from the remaining 2 nodes. - Start the node that was brought down. - Leader falls into a possible irrecoverable state with respect to appending log entries to the follower. Stack trace > 2020-12-15 15:42:01,572 [omNode-3@group-523986131536->omNode-2-GrpcLogAppender-LogAppenderDaemon] > ERROR leader.LogAppenderDaemon (LogAppenderDaemon.java:run(86)) - omNode-3@group-523986131536->omNode-2-> GrpcLogAppender-LogAppenderDaemon failed >org.apache.ratis.server.raftlog.RaftLogIOException: Log entry not found: index = 205 > at org.apache.ratis.server.raftlog.segmented.SegmentedRaftLog.getEntryWithData(SegmentedRaftLog.java:283) > at org.apache.ratis.server.leader.LogAppenderBase.newAppendEntriesRequest(LogAppenderBase.java:143) > at org.apache.ratis.grpc.server.GrpcLogAppender.appendLog(GrpcLogAppender.java:210) > at org.apache.ratis.grpc.server.GrpcLogAppender.run(GrpcLogAppender.java:144) > at org.apache.ratis.server.leader.LogAppenderDaemon.run(LogAppenderDaemon.java:77) > at java.lang.Thread.run(Thread.java:748) >2020-12-15 15:42:01,572 [omNode-3@group-523986131536->omNode-2-GrpcLogAppender-LogAppenderDaemon] INFO >server.RaftServer$Division (LeaderStateImpl.java:restart(497)) - omNode-3@group-523986131536-LeaderStateImpl: >Restarting GrpcLogAppender for omNode-3@group-523986131536->omNode-2 **Fix** Add the appropriate check in GrpcLogAppender#shouldNotifyToInstallSnapshot to cover the case when the leader has no logs. ## What is the link to the Apache JIRA Manually tested on Ozone cluster. ---------------------------------------------------------------- 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]
