itoumlilt opened a new pull request, #20289:
URL: https://github.com/apache/kafka/pull/20289

   Following JIRA Ticket: https://issues.apache.org/jira/browse/KAFKA-19571 
   
   A race condition can occur during replica rebalancing where a log segment's 
file is deleted after an asynchronous flush has been scheduled but before it 
executes.
   
   This would previously cause an unhandled `ClosedChannelException`, leading 
the` ReplicaManager` to mark the entire log directory as offline.
   
   The fix involves catching the `ClosedChannelException` within the 
`LogSegment.flush()` method and suppressing it only if the underlying log file 
no longer exists, which is the specific symptom of this race condition. 
Legitimate I/O errors on existing files will still be thrown.
   
   Unit test has been added to `LogSegmentTest` to verify both the fix and the 
case where the exception should still be thrown.


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to