lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <cutt...@lucene.com>
Subject Re: PATCH: IndexReaderDelete (Bugzilla Bug 12588)
Date Fri, 12 Sep 2003 17:50:54 GMT
+1

Thanks again for the patches,

Doug

Christoph Goller wrote:
> This is a patch for Bug 12588.
> 
> Problem:
> 
> If a reader is opened (reader1) on an index without acquiring a 
> write.lock and
> later the index is changed by either another reader (reader2) or a 
> writer, the
> first reader can still acquire a write.lock and change the index. Thus
> the changes by reader1 or the writer are lost. My patch adds an 
> additional check
> to Indexreader.delete(int) which checks whether the index has changed 
> since the reader
> was opened. Since this check is done with a valid write.lock no other 
> reader/writer
> could interfere with the check. If the index has been changed the reader 
> is not
> granted write permission. The only way to delete a document in such a 
> case is to
> get a new reader and call delete there. The patch for IndexReader and a 
> unit test are
> attached.
> 
> Christoph


Mime
View raw message