[ https://issues.apache.org/jira/browse/KAFKA-5332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16026011#comment-16026011 ]
ASF GitHub Bot commented on KAFKA-5332: --------------------------------------- GitHub user ZanderXu opened a pull request: https://github.com/apache/kafka/pull/3150 modify code to fix KAFKA-5332 this modify is to fix [KAFKA-5332](https://issues.apache.org/jira/browse/KAFKA-5332) You can merge this pull request into a Git repository by running: $ git pull https://github.com/ZanderXu/kafka branch1 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/3150.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3150 ---- commit eeb457c505dca5e0c53d0c37b533f461957b5795 Author: xuzq <xuzq> Date: 2017-05-26T08:44:05Z modify code to fix KAFKA-5332 ---- > When resize the index file, maybe caused the content disappear > -------------------------------------------------------------- > > Key: KAFKA-5332 > URL: https://issues.apache.org/jira/browse/KAFKA-5332 > Project: Kafka > Issue Type: Bug > Components: core, log > Affects Versions: 0.10.2.1 > Reporter: xuzq > > When resize the index file, maybe caused the content disappear. > When the kafka server is running, someone removed the index file on the disk > manually, if at this point, the function AbstractIndex.Resize(newSize: Int) > is triggered, it will create a new .index file which the size is > roundedNewSize, but the content is empty. > After this, the contents of mmap is empty. > When looking for specific offset corresponds to position, it also return > zero. The index file to locate the position does not provide any convenience. > I think if the ".index" is not exist, we should copy the contents from old > "mmap" to new "mmap" to avoid the "empty file". -- This message was sent by Atlassian JIRA (v6.3.15#6346)