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

if set topic config segment.ms=0 Kafka broker won't be able to start

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0
    • Fix Version/s: 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      If set topic config segment.ms to 0, Kafka server won't be able to start because of a FATAL error:

      [2018-03-12 19:05:40,196] FATAL [KafkaServer id=2] Fatal error during KafkaServer startup. Prepare to shutdown (kafka.server.KafkaServer) java.lang.ArithmeticException: / by zero at kafka.log.LogConfig.randomSegmentJitter(LogConfig.scala:100) at kafka.log.Log.loadSegments(Log.scala:419) at kafka.log.Log.<init>(Log.scala:203) at kafka.log.Log$.apply(Log.scala:1734) at kafka.log.LogManager.kafka$log$LogManager$$loadLog(LogManager.scala:221) at kafka.log.LogManager$$anonfun$loadLogs$2$$anonfun$8$$anonfun$apply$16$$anonfun$apply$2.apply$mcV$sp(LogManager.scala:292) at kafka.utils.CoreUtils$$anon$1.run(CoreUtils.scala:61) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748)

      https://github.com/apache/kafka/blob/1.0/core/src/main/scala/kafka/log/LogConfig.scala#L100

      So the minimum value shouldn't be 0
      https://kafka.apache.org/documentation/#topicconfigs

        Attachments

          Activity

            People

            • Assignee:
              huxi_2b huxihx
              Reporter:
              ewangchong Chong Wang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: