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

dirtyNonActiveSegments in `cleanableOffsets` should only be created when log.cleaner.min.compaction.lag.ms > 0

    XMLWordPrintableJSON

    Details

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

      Description

      LogCleanerManager.cleanableOffsets always created objects to hold all dirty non-active segments, as shown below:

      // dirty log segments
          val dirtyNonActiveSegments = log.logSegments(firstDirtyOffset, log.activeSegment.baseOffset)
      

      Actually, these objects will not be used when `log.cleaner.min.compaction.lag.ms` is 0 which is already the default value. We could defer the creation. In doing so can we reduce the heap size but also avoid the blocking access to the segments incurred by Log.segments.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: