Kafka
  1. Kafka
  2. KAFKA-753

Kafka broker shuts down while loading segments

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Duplicate
    • Affects Version/s: 0.8.0
    • Fix Version/s: 0.8.0
    • Component/s: log
    • Labels:

      Description

      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)

        Activity

        Hide
        Neha Narkhede added a comment -

        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.

        Show
        Neha Narkhede added a comment - 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.
        Hide
        Jun Rao added a comment -

        Likely fixed in kafka-748 and kafka-757.

        Show
        Jun Rao added a comment - Likely fixed in kafka-748 and kafka-757.

          People

          • Assignee:
            Sriram Subramanian
            Reporter:
            Neha Narkhede
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development