kevin-wu24 commented on code in PR #17528:
URL: https://github.com/apache/kafka/pull/17528#discussion_r1806714453
##########
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:
Oh. My mistake then; I misremembered. I'm good with fixing LogSegment, since
it makes more sense than startOffset not necessarily equaling the offset of the
start byte position returned.
I tried this approach when working on the other PR and I ran into some test
failures (among a lot of other failures) regarding the highWatermark since we
use `LogOffsetMetadata` to update it. Is it possible for the highWatermark be
in the middle of a batch? I have to do some more investigation to see what
exactly is going on.
I'll update this PR description and the Jira ticket.
--
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]