kevin-wu24 commented on code in PR #17500:
URL: https://github.com/apache/kafka/pull/17500#discussion_r1800207969


##########
raft/src/main/java/org/apache/kafka/raft/KafkaRaftClient.java:
##########
@@ -258,7 +260,8 @@ public KafkaRaftClient(
             localSupportedKRaftVersion,
             logContext,
             new Random(),
-            quorumConfig
+            quorumConfig,
+            new HashSet<>()

Review Comment:
   Looks like the log layer gets the batch associated with a `targetOffset` 
from `FileRecords#searchForOffsetWithSize`, but it currently returns the last 
offset included in that batch. It looks safe to change this to return the base 
offset instead, so we can retrieve the batch start offset for a given offset. 
`LogSegment#read` also needs to construct `LogOffsetMetadata` with this batch 
start offset instead of the `startOffset` that is passed into the method.



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