[ https://issues.apache.org/jira/browse/KAFKA-753?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13573696#comment-13573696 ]
Neha Narkhede commented on KAFKA-753: ------------------------------------- I'm not too sure about this, but one way this can happen is if indexSlotFor() returns a negative number (other than -1). It can return a negative number if this operation overflows - val mid = ceil(hi/2.0 + lo/2.0).toInt This can lead to a negative physical position that gets passed into messageSet.searchFor(offset, mapping.position) into translateOffset() and lead to this error. > Kafka broker shuts down while loading segments > ---------------------------------------------- > > Key: KAFKA-753 > URL: https://issues.apache.org/jira/browse/KAFKA-753 > Project: Kafka > Issue Type: Bug > Components: log > Affects Versions: 0.8 > Reporter: Neha Narkhede > Assignee: Jay Kreps > Priority: Blocker > Labels: bugs, p1 > > 2013/02/07 16:22:15.862 FATAL [KafkaServerStartable] [main] [kafka] [] Fatal > error during KafkaServe > rStable startup. Prepare to shutdown > java.lang.IllegalArgumentException: Negative position > at sun.nio.ch.FileChannelImpl.read(FileChannelImpl.java:610) > at kafka.log.FileMessageSet.searchFor(FileMessageSet.scala:83) > at kafka.log.LogSegment.translateOffset(LogSegment.scala:76) > at kafka.log.LogSegment.read(LogSegment.scala:91) > at kafka.log.LogSegment.nextOffset(LogSegment.scala:141) > at kafka.log.Log.<init>(Log.scala:128) > at > kafka.log.LogManager$$anonfun$loadLogs$1$$anonfun$apply$3.apply(LogManager.scala:115) > at > kafka.log.LogManager$$anonfun$loadLogs$1$$anonfun$apply$3.apply(LogManager.scala:109) > at > scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34) > at scala.collection.mutable.ArrayOps.foreach(ArrayOps.scala:34) > at > kafka.log.LogManager$$anonfun$loadLogs$1.apply(LogManager.scala:109) > at > kafka.log.LogManager$$anonfun$loadLogs$1.apply(LogManager.scala:101) > at > scala.collection.IndexedSeqOptimized$class.foreach(IndexedSeqOptimized.scala:34) > at > scala.collection.mutable.WrappedArray.foreach(WrappedArray.scala:32) > at kafka.log.LogManager.loadLogs(LogManager.scala:101) > at kafka.log.LogManager.<init>(LogManager.scala:62) > at kafka.server.KafkaServer.startup(KafkaServer.scala:59) > at > kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:34) -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira