lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <DCutt...@grandcentral.com>
Subject RE: Lucene 1.2 and directory write permissions?
Date Fri, 05 Oct 2001 16:25:00 GMT
> From: Snyder, David [mailto:dsnyder@netgenics.com]
> 
> I've been porting our application to use the 1.2 release 
> candidate 1 build
> and now have a problem opening searchers on our existing 
> indexes.  I get a
> Permission Denied exception...  our permissions are set up to 
> allow reading
> of the directory and contained files during a search, but not writing.

Hmm.  That is a problem.  The reader now creates a lock file while it is
opening the index to keep a writer process from deleting files while they're
being opened.  When opening an index the reader must first read the list of
files to open, then open them.  If between reading the list and opening a
file that file were to disappear, then the open would fail.  This was the
longstanding race condition that is fixed by the lock files.  A writing
process will now wait for the reader to open all of the files before
updating things.

Perhaps we should instead write lock files in a subdirectory of the index
named "locks".  You could make that directory read/write, but make the
parent read-only.  Alternately, we could have an flag that turns off the use
of lock files, for those who know that there is no other process that is
potentially simultaneously updating the index.  Which approach would folks
prefer?

Doug

Mime
View raw message