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

Integer overflow in log cleaner cleanable ratio computation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.0, 0.11.0.2
    • Component/s: None
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: