[
https://issues.apache.org/jira/browse/KAFKA-19428?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17985783#comment-17985783
]
Lan Ding commented on KAFKA-19428:
----------------------------------
It seems like an IOException might not be thrown here. Only the
`maxTimestampSoFar()` and `shallowOffsetOfMaxTimestampSoFar()` methods could
potentially throw an IOException. However, the code within these methods that
throws the exception will only execute if `maxTimestampAndOffsetSoFar ==
TimestampOffset.UNKNOWN`. Yet, in the outer layer, we only enter this block
when `maxTimestampAndOffsetSoFar != TimestampOffset.UNKNOWN`.
> IOException during writing max timestamp should not be ignored
> --------------------------------------------------------------
>
> Key: KAFKA-19428
> URL: https://issues.apache.org/jira/browse/KAFKA-19428
> Project: Kafka
> Issue Type: Bug
> Reporter: Chia-Ping Tsai
> Assignee: Lan Ding
> Priority: Minor
>
> this is similar to KAFKA-19221. The IOException caused by writing max
> timestamp is currently ignored.
>
> {code:java}
> if (maxTimestampAndOffsetSoFar != TimestampOffset.UNKNOWN)
> Utils.swallow(LOGGER, Level.WARN, "maybeAppend", () ->
> timeIndex().maybeAppend(maxTimestampSoFar(),
> shallowOffsetOfMaxTimestampSoFar(), true));
> {code}
>
> That could be an issue since we assume the last entry is the max timestamp
> after restarting. If the write fails, the loading log should re-build the
> index to ensure it catches the "correct" max timestamp.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)