lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschindler <...@git.apache.org>
Subject [GitHub] lucenenet pull request: IOUtils fsync for directory fix
Date Tue, 06 Jan 2015 13:50:51 GMT
Github user uschindler commented on the pull request:

    https://github.com/apache/lucenenet/pull/43#issuecomment-68867010
  
    fsync on directory is more than fsyncing all files in it (there is a difference between
syncing metadata and syncing buffers). Mike McCandless did tests on Linux (he has a machine
that he hardly switched off in a loop with remote hardware power plug) and he tested it: When
machine came up, index was still alive (he tested Linux).
    
    Fsync on directory flushes the file buffers of the directory *+ its metadata*. The first
one is also done by syncing metadata of a file contained, yes that works, but the directory's
metadata is not necessarily written. Because of that it could happen that the inode of the
directory is there, but the entry in the parent directory not yet (because the directory's
metadata was not yet synced). After hard kill of machine, the fsck will report a lost+found
inode (the directory). Because of the lost dir entry, the directory itsself is not visible
in its parent.
    
    I would still try to fsync also in windows, maybe it works at some time. And this is what
we are doing in Lucene Java - we just try the POSIX semantics, which *may* work on Windows.
So it is just best effort.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message