Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-7401

Broker fails to start when recovering a segment from before the log start offset

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.0, 1.1.1
    • Fix Version/s: 1.1.2
    • Component/s: log
    • Labels:
      None

      Description

      If a segment needs to be recovered (for example, because of a missing index file or uncompleted swap operation) and its base offset is less than the log start offset, the broker will crash with the following error:

      Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer)
      java.lang.IllegalArgumentException: inconsistent range
      at java.util.concurrent.ConcurrentSkipListMap$SubMap.<init>(Unknown Source)
      at java.util.concurrent.ConcurrentSkipListMap.subMap(Unknown Source)
      at java.util.concurrent.ConcurrentSkipListMap.subMap(Unknown Source)
      at kafka.log.Log$$anonfun$12.apply(Log.scala:1579)
      at kafka.log.Log$$anonfun$12.apply(Log.scala:1578)
      at scala.Option.map(Option.scala:146)
      at kafka.log.Log.logSegments(Log.scala:1578)
      at kafka.log.Log.kafka$log$Log$$recoverSegment(Log.scala:358)
      at kafka.log.Log$$anonfun$completeSwapOperations$1.apply(Log.scala:389)
      at kafka.log.Log$$anonfun$completeSwapOperations$1.apply(Log.scala:380)
      at scala.collection.immutable.Set$Set1.foreach(Set.scala:94)
      at kafka.log.Log.completeSwapOperations(Log.scala:380)
      at kafka.log.Log.loadSegments(Log.scala:408)
      at kafka.log.Log.<init>(Log.scala:216)
      at kafka.log.Log$.apply(Log.scala:1765)
      at kafka.log.LogManager.kafka$log$LogManager$$loadLog(LogManager.scala:260)
      at kafka.log.LogManager$$anonfun$loadLogs$2$$anonfun$11$$anonfun$apply$15$$anonfun$apply$2.apply$mcV$sp(LogManager.scala:340)
      at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:62)
      at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
      at java.util.concurrent.FutureTask.run(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
      at java.lang.Thread.run(Unknown Source)

      Since these segments are outside the log range, we should delete them, or at least not block broker startup because of them.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                apovzner Anna Povzner
                Reporter:
                bob-barrett Bob Barrett
              • Votes:
                2 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: