kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nehanarkh...@apache.org
Subject svn commit: r1419627 - /kafka/branches/0.8/core/src/main/scala/kafka/log/Log.scala
Date Mon, 10 Dec 2012 18:23:23 GMT
Author: nehanarkhede
Date: Mon Dec 10 18:23:22 2012
New Revision: 1419627

URL: http://svn.apache.org/viewvc?rev=1419627&view=rev
Log:
KAFKA-654 Irrecoverable error while trying to roll a segment that already exists; patched
by Neha Narkhede; reviewed by Jay Kreps

Modified:
    kafka/branches/0.8/core/src/main/scala/kafka/log/Log.scala

Modified: kafka/branches/0.8/core/src/main/scala/kafka/log/Log.scala
URL: http://svn.apache.org/viewvc/kafka/branches/0.8/core/src/main/scala/kafka/log/Log.scala?rev=1419627&r1=1419626&r2=1419627&view=diff
==============================================================================
--- kafka/branches/0.8/core/src/main/scala/kafka/log/Log.scala (original)
+++ kafka/branches/0.8/core/src/main/scala/kafka/log/Log.scala Mon Dec 10 18:23:22 2012
@@ -591,12 +591,12 @@ private[kafka] class Log(val dir: File, 
   def truncateAndStartWithNewOffset(newOffset: Long) {
     lock synchronized {
       val deletedSegments = segments.trunc(segments.view.size)
-      debug("Truncate and start log '" + name + "' to " + newOffset)
-      segments.append(new LogSegment(dir, 
+      info("Truncate and start log '" + name + "' to " + newOffset)
+      deleteSegments(deletedSegments)
+      segments.append(new LogSegment(dir,
                                      newOffset,
                                      indexIntervalBytes = indexIntervalBytes, 
                                      maxIndexSize = maxIndexSize))
-      deleteSegments(deletedSegments)
       this.nextOffset.set(newOffset)
     }
   }



Mime
View raw message