junrao commented on code in PR #15904:
URL: https://github.com/apache/kafka/pull/15904#discussion_r1595670550


##########
core/src/test/scala/unit/kafka/log/LogValidatorTest.scala:
##########
@@ -414,7 +414,15 @@ class LogValidatorTest {
     assertEquals(now + 1, validatingResults.maxTimestampMs,
       s"Max timestamp should be ${now + 1}")
 
-    assertEquals(2, validatingResults.shallowOffsetOfMaxTimestamp)
+    // V2: Only one batch is in the records, so the shallow 
OffsetOfMaxTimestamp is the last offset of the single batch
+    // V1: 3 batches are in the records, so the shallow OffsetOfMaxTimestamp 
is the timestamp of branch-1

Review Comment:
   Hmm, what is branch?



##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -1177,6 +1177,8 @@ class UnifiedLog(@volatile var logStartOffset: Long,
       validBytesCount += batchSize
 
       val batchCompression = CompressionType.forId(batch.compressionType.id)
+      // V2: only one batch regardless of compression

Review Comment:
   This is not very accurate. `analyzeAndValidateRecords()` is called in the 
follower append too, which could include more than one batch. It's just that 
sourceCompression is only used on the leader path, which only contains one 
batch currently.



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