RATIS-2499. Allow the LogAppender restart when LogAppenderDaemon exception#1425
Merged
szetszwo merged 4 commits intoapache:masterfrom Apr 8, 2026
Merged
RATIS-2499. Allow the LogAppender restart when LogAppenderDaemon exception#1425szetszwo merged 4 commits intoapache:masterfrom
szetszwo merged 4 commits intoapache:masterfrom
Conversation
szetszwo
reviewed
Apr 7, 2026
Contributor
szetszwo
left a comment
There was a problem hiding this comment.
@xichen01 , thanks for catching this bug! The change looks good. Please see the comment inlined.
This bug actually is quite serious that the Ratis 3.2.2 release becomes unusable. Isn't it?
Sorry that the bug was from my review. Cc @OneSizeFitsQuorum , @adoroszlai , @ivandika3 , @symious
Comment on lines
131
to
135
| private boolean isLeaderReady() { | ||
| return server.getInfo().isAlive() | ||
| && server.getInfo().isLeader() | ||
| && getRaftLog().isOpened(); | ||
| } |
Contributor
There was a problem hiding this comment.
- Since we already have defined isLeaderReady(), which means that a new leader has committed the first entry. Let's use a different name
isLeaderAlive()to avoid confusion. - Also, please use 4 spaces for indentation. It really looks better in this case.
private boolean isLeaderAlive() {
return server.getInfo().isAlive()
&& server.getInfo().isLeader()
&& getRaftLog().isOpened();
}
ivandika3
approved these changes
Apr 8, 2026
szetszwo
approved these changes
Apr 8, 2026
Contributor
szetszwo
left a comment
There was a problem hiding this comment.
+1 the change looks good.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
RATIS-2427 let the LogAppender do not restart when the LogAppenderDaemon in CLOSING or CLOSED or EXCEPTION LifeCycle.States . However, if only LogAppenderDaemon is EXCEPTION LifeCycle.States, we should still restart LogAppender.
LeaderStateImpl#restart will create a new GrpcLogAppender (see addAndStartSenders -> addSenders -> LeaderStateImpl#newLogAppender) and a new LogAppenderDaemon. The old LogAppenderDaemon will be shutdown
Therefore, if the old LogAppenderDaemon enters the EXCEPTION lifecycle for some reason, we should attempt to restart LogAppender
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2499
How was this patch tested?
new added test