Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/src/main/scala/kafka/log/LogCleaner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -735,9 +735,9 @@ private[log] class Cleaner(val id: Int,
* 1) if there exists a message with the same key but higher offset
* 2) if the message is a delete "tombstone" marker and enough time has passed
*/
val redundant = foundOffset >= 0 && record.offset < foundOffset
val latestOffsetForKey = record.offset() >= foundOffset
val obsoleteDelete = !retainDeletes && !record.hasValue
Comment thread
FreeeeLy marked this conversation as resolved.
Outdated
!redundant && !obsoleteDelete
latestOffsetForKey && !obsoleteDelete
} else {
stats.invalidMessage()
false
Expand Down