You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jun Rao (Jira)" <ji...@apache.org> on 2021/03/31 00:33:00 UTC

[jira] [Resolved] (KAFKA-12571) Eliminate LeaderEpochFileCache constructor dependency on LogEndOffset

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

Jun Rao resolved KAFKA-12571.
-----------------------------
    Fix Version/s: 3.0.0
       Resolution: Fixed

merged the PR to trunk

> Eliminate LeaderEpochFileCache constructor dependency on LogEndOffset
> ---------------------------------------------------------------------
>
>                 Key: KAFKA-12571
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12571
>             Project: Kafka
>          Issue Type: Sub-task
>          Components: core
>            Reporter: Kowshik Prakasam
>            Assignee: Kowshik Prakasam
>            Priority: Major
>             Fix For: 3.0.0
>
>
> *This is a precursor to KAFKA-12553.*
> Before refactoring the recovery logic (KAFKA-12553), we would like to move the logic to [initialize LeaderEpochFileCache|https://github.com/apache/kafka/blob/d9bb2ef596343da9402bff4903b129cff1f7c22b/core/src/main/scala/kafka/log/Log.scala#L579] outside the Log class.  Once we suitably initialize LeaderEpochFileCache outside Log, we will be able pass it as a dependency into both the Log class constructor and the recovery module. However, the LeaderEpochFileCache constructor takes a [dependency|https://github.com/apache/kafka/blob/d9bb2ef596343da9402bff4903b129cff1f7c22b/core/src/main/scala/kafka/server/epoch/LeaderEpochFileCache.scala#L42] on logEndOffset (via a callback). This dependency prevents the instantiation of LeaderEpochFileCache outside Log class.
> This situation blocks the recovery logic (KAFKA-12553) refactor. So this constructor dependency on logEndOffset needs to be eliminated.
> It turns out the logEndOffset dependency is used only in 1 of the LeaderEpochFileCache methods: LeaderEpochFileCache.endOffsetFor, and just for 1 particular [case|#L201]. Therefore, it should be possible to modify this so that   we only pass the logEndOffset as a parameter into endOffsetFor whenever the method is called.
>  
>  



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