[ 
https://issues.apache.org/jira/browse/KAFKA-17803?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17890977#comment-17890977
 ] 

José Armando García Sancio commented on KAFKA-17803:
----------------------------------------------------

[~kevinwu2412] I thought we agreed on the opposite. To change the UnifiedLog 
and LogSegment implementation to return the offset at the start of the batch 
since that is the offset that is located at the byte start position of the 
batch.

> Reconcile Differences in MockLog and KafkaMetadataLog `read` Implementation
> ---------------------------------------------------------------------------
>
>                 Key: KAFKA-17803
>                 URL: https://issues.apache.org/jira/browse/KAFKA-17803
>             Project: Kafka
>          Issue Type: Improvement
>            Reporter: Kevin Wu
>            Assignee: Kevin Wu
>            Priority: Major
>
> Calling MockLog or KafkaMetadataLog's read method for a given startOffset 
> returns a LogOffsetMetadata object that contains an offset field. In the case 
> of MockLog, this offset field is the base offset of the record batch which 
> contains startOffset.
> However, in KafkaMetadataLog, this offset field is set to the given 
> startOffset. If the given startOffset is in the middle of a batch, the 
> returned LogOffsetMetadata will have an offset that does not match the file 
> position of the returned batch. This makes the javadoc for LogSegment#read 
> inaccurate in this case since startOffset is not a lower bound (the base 
> offset of the batch containing startOffset is the lower bound). 
> The discussed approach was to change MockLog to behave the same way as 
> KafkaMetadataLog, since this would be safer than changing the semantics of 
> the read call in UnifiedLog.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to