Perfloop Agent created KAFKA-21629:
--------------------------------------

             Summary: Unclean-shutdown log recovery truncates valid segments 
when an I/O error occurs
                 Key: KAFKA-21629
                 URL: https://issues.apache.org/jira/browse/KAFKA-21629
             Project: Kafka
          Issue Type: Bug
          Components: log
            Reporter: Perfloop Agent


Since KAFKA-14482 (#17042) moved LogLoader to the storage module, 
LogLoader.recoverLog catches IOException as well as InvalidOffsetException. A 
storage failure during segment recovery, such as a failed producer-state 
snapshot write, is then handled like record corruption: the recovered segment 
is truncated to empty and later unflushed segments are deleted. The Scala 
LogLoader caught only InvalidOffsetException; with it, a storage error took the 
log directory offline.

Fix: restrict the catch back to InvalidOffsetException so storage errors reach 
LogManager.loadLogs and mark the directory offline. PR: 
https://github.com/apache/kafka/pull/24336



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to