lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: Lock File
Date Thu, 29 Jun 2006 21:45:35 GMT

> What are the conditions that cause corruption?  If there is just one
> writer and multiple readers, is that safe?

The cases are well spelled out in Lucene in Action, section 2.9.

Generally, one writer and multiple readers is not safe for disabling 

For example, the IndexReader, when it is first instantiated, needs to 
read segment data structures from the index.  If an IndexWriter happens 
to be committing at the same time, this will cause corruption.  Also, if 
an IndexReader is doing deletes, an IndexWriter is adding new docs, that 
could also cause corruption (if you turn off locking).

Unless you have your own locking layer over Lucene it's generally 
dangerous to turn off its default  locking.

Also: you should generally try to have a single IndexReader (and 
IndexSearcher using it) that's shared across all "things" that need to 
run searches.

One question: why do you want / need to disable Lucene's default 
locking?  I'm trying to work through refactoring how Lucene does locking 
(see LUCENE-305 in Jira) so details on your use case can help guide 
these fixes.


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

View raw message