jolshan commented on a change in pull request #10041:
URL: https://github.com/apache/kafka/pull/10041#discussion_r572420716



##########
File path: core/src/main/scala/kafka/log/Log.scala
##########
@@ -341,10 +342,15 @@ class Log(@volatile private var _dir: File,
     
producerStateManager.removeStraySnapshots(segments.values().asScala.map(_.baseOffset).toSeq)
     loadProducerState(logEndOffset, reloadFromCleanShutdown = hadCleanShutdown)
 
-    // Recover topic ID if present
+    // Delete partition metadata file if the version does not support topic 
IDs.
+    // Recover topic ID if present and topic IDs are supported
     partitionMetadataFile.foreach { file =>
-      if (!file.isEmpty())
-        topicId = file.read().topicId
+      if (file.exists()) {
+        if (!usesTopicId)
+          file.delete()

Review comment:
       I modeled this off of `leaderEpochCache` which is also an option. But I 
see how that is different now.




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

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


Reply via email to