drawxy commented on code in PR #14553:
URL: https://github.com/apache/kafka/pull/14553#discussion_r1371202846


##########
core/src/main/scala/kafka/log/LogManager.scala:
##########
@@ -1156,6 +1156,9 @@ class LogManager(logDirs: Seq[File],
       // we will add metrics back after sourceLog remove the metrics
       destLog.removeLogMetrics()
       destLog.updateHighWatermark(sourceLog.highWatermark)
+      sourceLog.leaderEpochCache.foreach(cache =>
+        cache.latestEntry.map(entry =>
+          destLog.maybeAssignEpochStartOffset(entry.epoch, entry.startOffset)))

Review Comment:
   If not, there wouldn't be leader epoch cache for the log after altering log 
dir without any produce traffic. As written in description, "The cache for each 
partition is updated only when appending new messages or becoming leader. If 
there is no traffic and the replica is already the leader, the cache will not 
be updated any more."



-- 
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