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

Starting offset breach based log segment deletion never considers active segment

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • core
    • None

    Description

      This observation is related to KIP-107: in Log#deleteLogStartOffsetBreachedSegments, we designed the predicate to enforce that the current segment can only be considered for deletion, when it 1) has the next segment, 2) the next segment's starting offset is no larger than the log start offset.

      def shouldDelete(segment: LogSegment, nextSegmentOpt: Option[LogSegment]) =
            nextSegmentOpt.exists(_.baseOffset <= logStartOffset)
      

      This means that, the current active segment would never be considered for purging. Normally this is OK given that we will eventually roll out a new segment. However, with the default size of segment of 1GB it means that with the purge data API we are in the worst case not being able to purge the data for up to 1GB per topic partition.

      Attachments

        Activity

          People

            Unassigned Unassigned
            guozhang Guozhang Wang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: