Ivan Andika created RATIS-2823:
----------------------------------
Summary: New LogAppender should inherit the previous LogAppender
follower indices
Key: RATIS-2823
URL: https://issues.apache.org/jira/browse/RATIS-2823
Project: Ratis
Issue Type: Improvement
Reporter: Ivan Andika
Assignee: Ivan Andika
LeaderStateImpl#restart is called when LogAppenderDaemon encountered an
exception.
This would stop the previous LogAppender and create a new LogAppender but with
nextIndex = 0 instead of the previously nextIndex from the previous
LogAppender. This can trigger unnecessary notifyInstallSnapshot to the follower
since it checks that the nextIndex is less than the firstIndex although the log
appender has seen the nextIndex before.
Possible improvement: Within the same leader term, retain {{{}nextIndex{}}},
matchIndex snapshot information, and relevant follower state. Initialize the
replacement’s cursor at {{matchIndex + 1}} and recreate its streams and pending
requests. Fence callbacks from the retired appender so they cannot affect
current replication. This avoids restarting recovery from index zero.
However, the LEAST_VALID_LOG_INDEX for the new LogAppender might be intentional
[https://github.com/apache/ratis/commit/2218f276adf11c0f8f04b2085e72f1c11a4ee56d]
so need more clarifications.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)