kafka-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject [kafka] branch trunk updated: KAFKA-6637; Avoid divide by zero error with segment.ms set to zero (#4698)
Date Sat, 24 Mar 2018 19:14:58 GMT
This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new dd78b9f  KAFKA-6637; Avoid divide by zero error with segment.ms set to zero (#4698)
dd78b9f is described below

commit dd78b9fa268ad1708b6e6da583e8b7e2a6bd690a
Author: huxi <huxi_2b@hotmail.com>
AuthorDate: Sun Mar 25 03:14:53 2018 +0800

    KAFKA-6637; Avoid divide by zero error with segment.ms set to zero (#4698)
    
    Require a minimum value of 1 for `segment.ms` to avoid division by zero when computing
random jitter.
    
    Reviewers: Manikumar Reddy O <manikumar.reddy@gmail.com>, Jason Gustafson <jason@confluent.io>
---
 core/src/main/scala/kafka/log/LogConfig.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/core/src/main/scala/kafka/log/LogConfig.scala b/core/src/main/scala/kafka/log/LogConfig.scala
index 30ca333..0db49e7 100755
--- a/core/src/main/scala/kafka/log/LogConfig.scala
+++ b/core/src/main/scala/kafka/log/LogConfig.scala
@@ -214,7 +214,7 @@ object LogConfig {
     new LogConfigDef()
       .define(SegmentBytesProp, INT, Defaults.SegmentSize, atLeast(Message.MinMessageOverhead),
MEDIUM,
         SegmentSizeDoc, KafkaConfig.LogSegmentBytesProp)
-      .define(SegmentMsProp, LONG, Defaults.SegmentMs, atLeast(0), MEDIUM, SegmentMsDoc,
+      .define(SegmentMsProp, LONG, Defaults.SegmentMs, atLeast(1), MEDIUM, SegmentMsDoc,
         KafkaConfig.LogRollTimeMillisProp)
       .define(SegmentJitterMsProp, LONG, Defaults.SegmentJitterMs, atLeast(0), MEDIUM, SegmentJitterMsDoc,
         KafkaConfig.LogRollTimeJitterMillisProp)

-- 
To stop receiving notification emails like this one, please contact
jgus@apache.org.

Mime
View raw message