[ https://issues.apache.org/jira/browse/LUCENE-5570?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13959263#comment-13959263 ]
Uwe Schindler commented on LUCENE-5570: --------------------------------------- bq. after looking on the bug that lead to this issue I'd have appreciated to get a FNF exception rather than 0-byte files to begin with Which bug? About the patch: Looks fine. I am just a little bit sceptical if a sync() on a readonly file really does what the javadocs say (on all operating systems...). Can we test this somehow without using the power-switches of our computers? Maybe write a large file, sync it and while doing that check some {{/proc}} or {{/sys}} file to monitor how many unwritten buffers are there? > FSDirectory's fsync() is lenient > -------------------------------- > > Key: LUCENE-5570 > URL: https://issues.apache.org/jira/browse/LUCENE-5570 > Project: Lucene - Core > Issue Type: Bug > Components: core/store > Reporter: Robert Muir > Attachments: LUCENE-5570.patch, LUCENE-5570_zerobyte.patch > > > This method has a lot of problems: > 1. it tracks 'stale files' as it writes (this seems pointless), and only > actually fsyncs the intersection of that 'stale files' and the filenames > passed as argument to sync(). So any bogus names passed to sync() are just > silently ignored > 2. if "something bad happens" (e.g. two indexwriters/dirs on the same path, > or some other shenanigans), and the file is actually in stale files, but was > say actually deleted on the filesystem, the underlying fsync() call will > create a new 0-byte file and fsync that. > In my opinion we should do none of this. we should throw exceptions when this > stuff is wrong. -- This message was sent by Atlassian JIRA (v6.2#6252) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org