lbradstreet commented on a change in pull request #11199:
URL: https://github.com/apache/kafka/pull/11199#discussion_r688051998



##########
File path: core/src/test/scala/unit/kafka/log/LogCleanerManagerTest.scala
##########
@@ -541,6 +541,29 @@ class LogCleanerManagerTest extends Logging {
     while(log.numberOfSegments < 8)
       log.appendAsLeader(records(log.logEndOffset.toInt, 
log.logEndOffset.toInt, time.milliseconds()), leaderEpoch = 0)
 
+    log.updateHighWatermark(50)
+
+    val lastCleanOffset = Some(0L)
+    val cleanableOffsets = LogCleanerManager.cleanableOffsets(log, 
lastCleanOffset, time.milliseconds)
+    assertEquals(0L, cleanableOffsets.firstDirtyOffset, "The first cleanable 
offset starts at the beginning of the log.")
+    assertEquals(log.highWatermark, 
cleanableOffsets.firstUncleanableDirtyOffset, "The first uncleanable offset is 
bounded by the hwm.")

Review comment:
       This is what I intended since the lastStableOffset should equal the 
highWatermark, but I think it makes sense to keep the intent. Instead I have 
checked that log.highWatermark == log.lastStableOffset in the line prior to it.




-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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


Reply via email to