kamalcph commented on code in PR #15825:
URL: https://github.com/apache/kafka/pull/15825#discussion_r1598838884


##########
core/src/test/scala/unit/kafka/log/UnifiedLogTest.scala:
##########
@@ -391,8 +398,10 @@ class UnifiedLogTest {
         assertNonEmptyFetch(log, offset, FetchIsolation.HIGH_WATERMARK)
       }
 
-      (log.highWatermark to log.logEndOffset).foreach { offset =>
-        assertEmptyFetch(log, offset, FetchIsolation.HIGH_WATERMARK)
+      assertEmptyFetch(log, log.highWatermark, FetchIsolation.HIGH_WATERMARK)
+
+      (log.highWatermark + 1 to log.logEndOffset).foreach { offset =>

Review Comment:
   since `log.highWatermark` contains the full-metadata, divided the check into 
2 when reading at (or) beyond the high-watermark:
   
   1) When the fetchOffset equals to the high-watermark, we return 
empty-records but with complete offset metadata
   2) When the fetchOffset is beyond the 
high-watermark/max-offset-allowed-to-read, we return empty-records with 
message-only metadata. 
   
   We can reconsider the case whether to return message-only-offset metadata 
(or) complete-offset metadata when the fetch-offset is beyond the 
`max-offset-allowed-to-read`. 
([comment](https://github.com/apache/kafka/pull/15825#discussion_r1598841362))
   
   
   



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