[ 
https://issues.apache.org/jira/browse/KAFKA-12153?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jason Gustafson resolved KAFKA-12153.
-------------------------------------
    Fix Version/s: 2.7.1
                   2.8.0
       Resolution: Fixed

> follower can hit OffsetOutOfRangeException during truncation
> ------------------------------------------------------------
>
>                 Key: KAFKA-12153
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12153
>             Project: Kafka
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 2.7.0
>            Reporter: Jun Rao
>            Assignee: Jason Gustafson
>            Priority: Major
>             Fix For: 2.8.0, 2.7.1
>
>
> Currently, we have the following code path.
> log.truncateTo() => updateLogEndOffset() => updateHighWatermarkMetadata() => 
> maybeIncrementFirstUnstableOffset() => convertToOffsetMetadataOrThrow() => 
> read()
> This path seems problematic. The issue is that updateLogEndOffset() is called 
> before loadProducerState() in log.truncateTo(). At that point, the 
> producerState is not reflecting the truncated state yet and 
> producerStateManager.firstUnstableOffset(called in 
> maybeIncrementFirstUnstableOffset() to feed read()) could return an offset 
> larger than the truncated logEndOffset, which will lead to 
> OffsetOutOfRangeException.
>  
> This issue is relatively rare since it requires truncation below the high 
> watermark.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to