You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jason Gustafson (JIRA)" <ji...@apache.org> on 2017/10/09 19:56:00 UTC

[jira] [Created] (KAFKA-6030) Integer overflow in log cleaner cleanable ratio computation

Jason Gustafson created KAFKA-6030:
--------------------------------------

             Summary: Integer overflow in log cleaner cleanable ratio computation
                 Key: KAFKA-6030
                 URL: https://issues.apache.org/jira/browse/KAFKA-6030
             Project: Kafka
          Issue Type: Bug
            Reporter: Jason Gustafson
             Fix For: 1.0.0, 0.11.0.2


In {{LogCleaner.LogToClean}}, the following computations, which are used to compute the cleanable ratio, can overflow since the segment size is an integer.
{code}
  val cleanBytes = log.logSegments(-1, firstDirtyOffset).map(_.size).sum
  ...
  val cleanableBytes = log.logSegments(firstDirtyOffset, math.max(firstDirtyOffset, firstUncleanableOffset)).map(_.size).sum
{code}

A PR is already available: https://github.com/apache/kafka/pull/4043.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)