lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
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:

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).

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.



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message