Repository: kafka
Updated Branches:
  refs/heads/trunk 1c93bb16a -> 19c98cb8e


kafka-1758; corrupt recovery file prevents startup; patched by Manikumar Reddy; 
reviewed by Neha Narkhede and Jun Rao


Project: http://git-wip-us.apache.org/repos/asf/kafka/repo
Commit: http://git-wip-us.apache.org/repos/asf/kafka/commit/19c98cb8
Tree: http://git-wip-us.apache.org/repos/asf/kafka/tree/19c98cb8
Diff: http://git-wip-us.apache.org/repos/asf/kafka/diff/19c98cb8

Branch: refs/heads/trunk
Commit: 19c98cb8ed69d3d6da787dc04e1e88add5f6b9d7
Parents: 1c93bb1
Author: Manikumar Reddy <manikumar.re...@gmail.com>
Authored: Thu Jun 18 18:50:52 2015 -0700
Committer: Jun Rao <jun...@gmail.com>
Committed: Thu Jun 18 18:50:52 2015 -0700

----------------------------------------------------------------------
 core/src/main/scala/kafka/log/LogManager.scala | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kafka/blob/19c98cb8/core/src/main/scala/kafka/log/LogManager.scala
----------------------------------------------------------------------
diff --git a/core/src/main/scala/kafka/log/LogManager.scala 
b/core/src/main/scala/kafka/log/LogManager.scala
index 538fc83..69386c1 100755
--- a/core/src/main/scala/kafka/log/LogManager.scala
+++ b/core/src/main/scala/kafka/log/LogManager.scala
@@ -126,7 +126,15 @@ class LogManager(val logDirs: Array[File],
         brokerState.newState(RecoveringFromUncleanShutdown)
       }
 
-      val recoveryPoints = this.recoveryPointCheckpoints(dir).read
+      var recoveryPoints = Map[TopicAndPartition, Long]()
+      try {
+        recoveryPoints = this.recoveryPointCheckpoints(dir).read
+      } catch {
+        case e: Exception => {
+          warn("Error occured while reading recovery-point-offset-checkpoint 
file of directory " + dir, e)
+          warn("Resetting the recovery checkpoint to 0")
+        }
+      }
 
       val jobsForDir = for {
         dirContent <- Option(dir.listFiles).toList

Reply via email to