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: IndexReader locking
Date Mon, 28 Nov 2005 18:06:19 GMT
IndexReader locks the index while opening it to prohibit an IndexWriter 
from deleting any of the files in that index until all are opened.

Lock files are not stored in the index directory since write access to 
an index should not be required to lock it while opening an IndexReader.

Doug

Daniel Noll wrote:
> While writing a simple stress testing exercise, I came across the 
> strange condition that the IndexReader locks the index even though it's 
> only supposed to be reading.
> 
> Now, I understand that IndexReader can in fact modify the index (no 
> matter how unintuitive that is) but it seems to me that a lockfile 
> stored on the local machine doesn't protect against modification by 
> someone on another machine anyway.
> 
> So it seems that either:
>    1. it shouldn't bother locking at all, since it isn't protecting the 
> index from anything, or
>    2. it should put its lockfile in the index directory itself, i.e. a 
> place where it will be seen by others who also intend to use the index.
> 
> But obviously there was some reason behind this choice, so it would be 
> good to know what it was before I go and modify our local copy to work 
> differently. :-)
> 
> Daniel
> 

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


Mime
View raw message