jsancio commented on code in PR #17528:
URL: https://github.com/apache/kafka/pull/17528#discussion_r1806619794


##########
raft/src/test/java/org/apache/kafka/raft/MockLog.java:
##########
@@ -425,7 +425,9 @@ public LogFetchInfo read(long startOffset, Isolation 
isolation) {
                 buffer = batch.writeTo(buffer);
 
                 if (batchStartOffset == null) {
-                    batchStartOffset = 
batch.entries.get(0).logOffsetMetadata();
+                    // Return the queried startOffset to match 
KafkaMetadataLog behavior when
+                    // the startOffset is in the middle of a batch
+                    batchStartOffset = new LogOffsetMetadata(startOffset, 
batch.entries.get(0).logOffsetMetadata().metadata());

Review Comment:
   @kevin-wu24 I thought we agreed in our offline discussion to instead fix 
LogSegment and UnifedLog to return the batch start offset since that is the 
actual offset that is pointed by the start byte position.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to