[ https://issues.apache.org/jira/browse/KAFKA-12233?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Chia-Ping Tsai updated KAFKA-12233: ----------------------------------- Summary: Align the length passed to FileChannel by `FileRecords.writeTo` (was: `FileRecords.writeTo` set length incorrectly) > Align the length passed to FileChannel by `FileRecords.writeTo` > --------------------------------------------------------------- > > 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)