gitlw commented on code in PR #12029:
URL: https://github.com/apache/kafka/pull/12029#discussion_r849092616


##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -687,8 +687,10 @@ class UnifiedLog(@volatile var logStartOffset: Long,
           producerStateManager.updateParentDir(dir)
           // re-initialize leader epoch cache so that 
LeaderEpochCheckpointFile.checkpoint can correctly reference
           // the checkpoint file in renamed log directory
-          initializeLeaderEpochCache()
-          initializePartitionMetadata()
+          if (reinitialize) {
+            initializeLeaderEpochCache()

Review Comment:
   That's a good point. I've set the leaderEpochCache to None, and also the 
partitionMetadataFile field after converting it to an Option.



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