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

Pavel Yaskevich commented on CASSANDRA-3250:
--------------------------------------------

bq. shouldn't the directory cache be per-Writer, not static?

It's useful to make it static instead of instantiation per-Writer because we 
need every writer to be able to see already open directories.

bq. why would the FD be null? if it shouldn't be, let's use an assert there

Directory FD could be null when it's the first time we see directory e.g. first 
time for commitlog, different data directories, also I made it that way because 
of CASSANDRA-2749.
                
> fsync the directory after new sstable or commit log segment are created
> -----------------------------------------------------------------------
>
>                 Key: CASSANDRA-3250
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3250
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Zhu Han
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.0.7
>
>         Attachments: CASSANDRA-3250.patch
>
>
> The mannual of fsync said:
> bq.   Calling  fsync()  does  not  necessarily  ensure  that  the entry in 
> the directory containing the file has also reached disk.  For that an 
> explicit fsync() on a file descriptor for the directory is also needed.
> At least on ext4, syncing the directory is a must to have step, as described 
> by [1]. Otherwise, the new sstables or commit logs could be missed after 
> crash even if itself is synced. 
> Unfortunately, JVM does not provide an approach to sync the directory...
> [1] 
> http://www.linuxfoundation.org/news-media/blogs/browse/2009/03/don%E2%80%99t-fear-fsync

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to