jolshan commented on a change in pull request #9590:
URL: https://github.com/apache/kafka/pull/9590#discussion_r527020272



##########
File path: core/src/main/scala/kafka/log/Log.scala
##########
@@ -1749,6 +1752,9 @@ class Log(@volatile private var _dir: File,
           checkIfMemoryMappedBufferClosed()
           // remove the segments for lookups
           removeAndDeleteSegments(deletable, asyncDelete = true, reason)
+          if (reason == LogCompaction) {
+            
maybeIncrementLogStartOffset(segments.firstEntry.getValue.baseOffset, 
SegmentCompaction)
+          }
           
maybeIncrementLogStartOffset(segments.firstEntry.getValue.baseOffset, 
SegmentDeletion)

Review comment:
       Sorry if this is a little confusing. `reason` is for deletion and the 
other parameter `SegmentCompaction` is the reason for changing the offset. 
Currently that is used to handle the issue for updating past the high 
watermark. I agree that it is not the cleanest way and we should figure out 
what we want to do with compacting past the high watermark.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to