CalvinConfluent commented on code in PR #14465:
URL: https://github.com/apache/kafka/pull/14465#discussion_r1362968373


##########
core/src/main/scala/kafka/log/LogManager.scala:
##########
@@ -1409,6 +1410,32 @@ class LogManager(logDirs: Seq[File],
       None
     }
   }
+
+  def readBrokerEpochFromCleanShutdownFiles(): Long = {
+    // Verify whether all the log dirs have the same broker epoch in their 
clean shutdown files. If there are dir is not
+    // live, fail the broker epoch check.
+    if (liveLogDirs.size < logDirs.size) {
+      return -1L
+    }
+    var brokerEpoch = -1L
+    for (dir <- liveLogDirs) {
+        val cleanShutdownFileHandler = new 
CleanShutdownFileHandler(dir.getPath)
+        var textBrokerEpoch = -1L
+        try {
+          textBrokerEpoch = cleanShutdownFileHandler.read
+        } catch {
+          case e: Throwable =>

Review Comment:
   Good catch!



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