lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: [jira] Commented: (LUCENE-665) temporary file access denied on Windows
Date Thu, 14 Sep 2006 02:27:48 GMT
Yonik Seeley wrote:
>> But, I'm still renaming segments_N.new -> segments_N,
> 
> Hmmm, remind me why you need the .new file?  Why can't you just create
> segments_N after you are finished writing all of the segments?

Because there could be a reader that tries to read the file before it's 
done being written.  It would hit EOF and throw an IOException.

And also, to avoid trouble with filesystem caching I'd to only ever open 
a given file X once X is done being written.  I think the "write once" 
approach (never re-using a file-name) prevents the kinds of caching 
issues that eg cause the problems over NFS.

>> however I think
>> we could remove that one by instead creating a separate "done" file, eg
>> "segments_N.done"
> 
> Yes, that sounds like it would work.  No renaming... cool!

I think so!  I will test it...

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org


Mime
View raw message