lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@apache.org>
Subject Re: Locking problems with NFS
Date Tue, 20 Apr 2004 19:00:07 GMT
Francesco Bellomi wrote:
> The only problem is that, as lucene 1.4rc2, FSDirectory is 'final'.

Please submit a patch to lucene-dev to make FSDirectory non-final.

> In fact, a third architectural approach would be to define an API for
> "pluggable" lock implementations: IMHO that would be more robust to changes
> in the Directory interface and implementations.

If you have a proposal, submit a patch to lucene-dev to make locking 
pluggable.

FYI, I just ran across another NFS-safe locking approach:

#    In NFS, the O_CREAT|O_EXCL isn't guaranteed to be atomic.
#    So we create a temp file that is probably unique in space
#    and time ($folder.lock.$time.$pid.$host).
#    Then we use link to create the real lock file. Since link
#    is atomic across nfs, this works.

This is from:

http://search.cpan.org/src/MARKOV/Mail-Box-2.053/lib/Mail/Box/Locker/NFS.pm

Unfortunately links are not supported by Java's io APIs, so I think the 
dotlock+fcntl() is probably best for Lucene.

Doug

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


Mime
View raw message