Vincent Jiang created KAFKA-14005:
-------------------------------------

             Summary: LogCleaner doesn't clean log if there is no dirty range
                 Key: KAFKA-14005
                 URL: https://issues.apache.org/jira/browse/KAFKA-14005
             Project: Kafka
          Issue Type: Bug
            Reporter: Vincent Jiang


When there is no dirty range to clean (firstDirtyOffset == 
firstUnclenableOffset), buildOffsetMap for dirty range returns an empty offset 
map, with map.latestOffset = -1.

 

Then target cleaning offset range becomes [startOffset, map.latestOffset + 1) = 
[startOffset, 0], hence no segments are cleaned.

 

The correct cleaning offset range should be [startOffset, firstDirtyOffset], so 
that the log can be cleaned again to remove abort/commit markers, or tombstones.

 

LogCleanerTest.FakeOffsetMap.clear() method has a bug - it doesn't reset 
lastOffset. This bug causes test case like testAbortMarkerRemoval() pass 
false-positively.

  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to