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

Integer overflow in log cleaner cleanable ratio computation

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.11.0.2, 1.0.0
    • None
    • None

    Description

      In LogCleaner.LogToClean, the following computations, which are used to compute the cleanable ratio, can overflow since the segment size is an integer.

        val cleanBytes = log.logSegments(-1, firstDirtyOffset).map(_.size).sum
        ...
        val cleanableBytes = log.logSegments(firstDirtyOffset, math.max(firstDirtyOffset, firstUncleanableOffset)).map(_.size).sum
      

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

      Attachments

        Activity

          People

            Xin Li Xin Li
            hachikuji Jason Gustafson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: