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

ASF GitHub Bot commented on KAFKA-3968:
---------------------------------------

GitHub user nepal opened a pull request:

    https://github.com/apache/kafka/pull/1626

    [KAFKA-3968] Call fsync for parent directory first time when we flush…

    … message set

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/nepal/kafka fsync-directory-on-flush

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/kafka/pull/1626.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 #1626
    
----
commit 205df3e0b2e951b3ec8555f108217f8b2793e237
Author: Andrey L. Neporada <anepor...@yandex-team.ru>
Date:   2016-07-15T15:38:25Z

    [KAFKA-3968] Call fsync for parent directory first time when we flush 
message set

----


> fsync() is not called on parent directory when new FileMessageSet is flushed 
> to disk
> ------------------------------------------------------------------------------------
>
>                 Key: KAFKA-3968
>                 URL: https://issues.apache.org/jira/browse/KAFKA-3968
>             Project: Kafka
>          Issue Type: Bug
>          Components: log
>    Affects Versions: 0.9.0.1, 0.10.0.0
>         Environment: Linux, ext4 filesystem
>            Reporter: Andrey Neporada
>
> Kafka does not call fsync() on directory when new log segment is created and 
> flushed to disk.
> The problem is that following sequence of calls doesn't guarantee file 
> durability: 
> fd = open("log", O_RDWR | O_CREATE); // suppose open creates "log"
> write(fd);
> fsync(fd);
> If system crashes after fsync() but before parent directory have been flushed 
> to disk, the log file can disappear.
> This is true at least for ext4 on Linux.
> Proposed solution is to flush directory when flush() is called for the first 
> time.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to