Repository navigation
RATIS-2647. Trigger shutdown for async log flush failure - #1643
Merged
Merged
Conversation
amaliujia
reviewed
Oct 15, 2026
| .whenComplete((v, e) -> { | ||
| updateFlushedIndexIncreasingly(lastWrittenIndex); | ||
| logSyncTimerContext.stop(); | ||
| if (e == null) { |
Contributor
There was a problem hiding this comment.
To be concrete, should we check IOException?
CompletableFuture<Void> asyncFlush(ExecutorService executor) throws IOException {
try {
return out.asyncFlush(executor);
} catch (IOException ioe) {
String msg = "Failed to asyncFlush " + this;
LOG.error(msg, ioe);
throw new IOException(msg, ioe);
}
}
Contributor
There was a problem hiding this comment.
IOException will be caught in SegmentedRaftLogWorker.
szetszwo
reviewed
Oct 15, 2026
szetszwo
left a comment
Contributor
There was a problem hiding this comment.
@ivandika3 , thanks for working on this!
Please see the comment inlined.
Comment on lines
+433
to
+435
| } else if (failureHandler != null) { | ||
| failureHandler.accept(e); | ||
| } |
Contributor
There was a problem hiding this comment.
Let's simply call server.close()?
if (e == null) {
updateFlushedIndexIncreasingly(scheduledFlushIndex);
} else {
LOG.error("{} Failed asyncFlush", this, e);
server.close();
}| .whenComplete((v, e) -> { | ||
| updateFlushedIndexIncreasingly(lastWrittenIndex); | ||
| logSyncTimerContext.stop(); | ||
| if (e == null) { |
Contributor
There was a problem hiding this comment.
IOException will be caught in SegmentedRaftLogWorker.
szetszwo
approved these changes
Oct 16, 2026
szetszwo
left a comment
Contributor
There was a problem hiding this comment.
+1 the chnage 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?
Trigger shutdown for async log flush failure. It should shutdown the server async flush failure since it is a fatal RaftLog error.
Generated-by: GPT 5.6 Terra.
What is the link to the Apache JIRA
https://issues.apache.org/jira/browse/RATIS-2647
How was this patch tested?
UT. Introduce a new injected failure for
FileChannel#forcethrough theFILE_CHANNEL_FORCEand check that the flush index is not increased and failure is set when failure was injected.