GitHub user msiuts opened 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.` ---- --- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---