[
https://issues.apache.org/jira/browse/KAFKA-16304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18127662#comment-18127662
]
Mykyta Bozhenko commented on KAFKA-16304:
-----------------------------------------
Update: Following [~junrao]'s review (thanks, Jun, for the explanation), the PR
now takes the log directory offline. {{FileRecords.writeTo}} passes a failed
transfer to a handler and rethrows the original exception; {{LocalLog}}
re-reads the region on its scheduler, at most one check at a time per log
directory, and calls {{LogDirFailureChannel.maybeAddOfflineLogDir}} only if the
read fails. End of file (a concurrent truncation) and
{{ClosedChannelException}} (a concurrent close) are treated as inconclusive.
TLS listeners also need KAFKA-21280
(https://github.com/apache/kafka/pull/23832).
https://github.com/apache/kafka/pull/23445
> Disk I/O error does not offline log directory while handling Fetch requests
> ---------------------------------------------------------------------------
>
> Key: KAFKA-16304
> URL: https://issues.apache.org/jira/browse/KAFKA-16304
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 3.6.1, 3.7.0
> Reporter: Gaurav Narula
> Priority: Critical
>
> The Fetch API handler delays reading of record batches from disk using
> {{FileRecords::writeTo}} until the bytes are ready to be sent to the wire.
> Therefore, a disk I/O error that happens while reading the log segment in
> either {{SslTransportLayer::transferFrom}} or
> {{PlaintextTransportLayer::transferFrom}} does not cause the log directory to
> be offlined. Instead, we assume that such an {{IOException}} can only occur
> because of network related causes and close the socket instead
> [[0]|https://github.com/apache/kafka/blob/7ac50a86113c9a489667451eecf61b6ab80870db/clients/src/main/java/org/apache/kafka/common/network/Selector.java#L610]
>
> [[1]|https://github.com/apache/kafka/blob/7ac50a86113c9a489667451eecf61b6ab80870db/clients/src/main/java/org/apache/kafka/common/network/Selector.java#L629]
> We should disambiguate between IOExceptions due to network and disk
> operations and offline the log directory in case of the latter as we do for
> other disk related failures.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)