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

Chia-Ping Tsai commented on KAFKA-12233:
----------------------------------------

{quote}
`FileRecords.writeTo` set length incorrectly
{quote}

Pardon me, I don't observe the error. "oldSize" is NOT an (end) index of file. 
Hence, we do get the correct new offset (start + input offset) and new length 
(min(input length, oldSize)).

> `FileRecords.writeTo` set length incorrectly
> --------------------------------------------
>
>                 Key: KAFKA-12233
>                 URL: https://issues.apache.org/jira/browse/KAFKA-12233
>             Project: Kafka
>          Issue Type: Bug
>            Reporter: dengziming
>            Assignee: dengziming
>            Priority: Major
>
> [https://github.com/apache/kafka/pull/2140/files#r563471404]
> we set `int count = Math.min(length, oldSize)`, but we are expected to write 
> from `offset`, so the count should be `Math.min(length, oldSize - offset)`.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to