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 18:24:48 GMT
Francesco Bellomi wrote:
> we are experiencing some difficulties in using Lucene with a NFS filesystem.
> Basically, locking seems not to work properly, since it appears that
> attempted concurring writing on the index (from different VMs) are not
> blocked, and this often causes the index to be corrupted.
> 
> Does anybody have a solution for this problem? Does anyone have some
> suggestions about the implementation of some alternative approach for
> locking, in order to make Lucene compatible with NFS?

I just found the following article, which might point the way:

http://www.spinnaker.de/linux/nfs-locking.html

FSDirectory.lock currently implements what this article calls 
"dotlocking".  One can implement fcntl() locking using nio, but this 
requires a 1.4 JVM, which Lucene does not (yet).

http://java.sun.com/j2se/1.4.2/docs/api/java/nio/channels/FileChannel.html#tryLock()

A couple of alternatives:

1. One could implement a 1.4-only subclass of FSDirectory in the Sandbox 
that implements dotlocking plus fcntl() locking.

2. We could add this directly into FSDirectory so that it will only 
compile in 1.4+ JDKs, but that it will run in earlier JDKs by only 
performing fcntl() locking when in a 1.4+ JVM.  Some folks would complain.

Thoughts?

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