junrao commented on code in PR #18321:
URL: https://github.com/apache/kafka/pull/18321#discussion_r1905814075


##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -509,8 +509,8 @@ class UnifiedLog(@volatile var logStartOffset: Long,
   }
 
   private def initializeLeaderEpochCache(): Unit = lock synchronized {
-    leaderEpochCache = UnifiedLog.maybeCreateLeaderEpochCache(
-      dir, topicPartition, logDirFailureChannel, logIdent, leaderEpochCache, 
scheduler)
+    leaderEpochCache = Some(UnifiedLog.createLeaderEpochCache(

Review Comment:
   We set `shouldReinitialize` is to false when the replica is no longer 
needed. So, we can just set `leaderEpochCache` to null in that case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to