[ https://issues.apache.org/jira/browse/KAFKA-3802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15339457#comment-15339457 ]
ASF GitHub Bot commented on KAFKA-3802: --------------------------------------- GitHub user msiuts reopened a pull request: https://github.com/apache/kafka/pull/1497 KAFKA-3802 log mtimes reset on broker restart / shutdown There seems to be a bug in the JDK that on some versions the mtime of the file is modified on FileChannel.truncate() even if the javadoc states `If the given size is greater than or equal to the file's current size then the file is not modified.`. This causes problems with log retention, as all the files then look like they contain recent data to Kafka. Therefore this is only done if the channel size is different to the target size. You can merge this pull request into a Git repository by running: $ git pull https://github.com/emetriq/kafka KAFKA-3802-log_mtimes_reset_on_broker_shutdown Alternatively you can review and apply these changes as the patch at: https://github.com/apache/kafka/pull/1497.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 #1497 ---- commit 13494b96bdc315f0f8f9f9a7762e4ab0589d357b Author: Moritz Siuts <m.si...@emetriq.com> Date: 2016-06-11T20:27:40Z KAFKA-3802 only call truncate if channel.size is different to target-size There seems to be a bug in the JDK that on some versions the mtime of the file is modified on FileChannel.truncate() even if the javadoc says `If the given size is greater than or equal to the file's current size then the file is not modified.` commit 61166945c6c4d878a08a0c39a21d864fe518f0ee Author: Moritz Siuts <m.si...@emetriq.com> Date: 2016-06-16T07:02:15Z KAFKA-3802 be more consistent in code style commit cf7aede9d234eb5cf2064dac92d5e52ef50f0970 Author: Moritz Siuts <m.si...@emetriq.com> Date: 2016-06-17T07:22:52Z KAFKA-3802 make mock less brittle ---- > log mtimes reset on broker restart > ---------------------------------- > > Key: KAFKA-3802 > URL: https://issues.apache.org/jira/browse/KAFKA-3802 > Project: Kafka > Issue Type: Bug > Affects Versions: 0.9.0.1 > Reporter: Andrew Otto > Fix For: 0.10.0.1 > > > Folks over in > http://mail-archives.apache.org/mod_mbox/kafka-users/201605.mbox/%3CCAO8=cz0ragjad1acx4geqcwj+rkd1gmdavkjwytwthkszfg...@mail.gmail.com%3E > are commenting about this issue. > In 0.9, any data log file that was on > disk before the broker has it's mtime modified to the time of the broker > restart. > This causes problems with log retention, as all the files then look like > they contain recent data to kafka. We use the default log retention of 7 > days, but if all the files are touched at the same time, this can cause us > to retain up to 2 weeks of log data, which can fill up our disks. > This happens *most* of the time, but seemingly not all. We have seen broker > restarts where mtimes were not changed. -- This message was sent by Atlassian JIRA (v6.3.4#6332)