Issue Details (XML | Word | Printable)

Key: LUCENE-1184
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Michael McCandless
Reporter: Michael McCandless
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

Allow SnapshotDeletionPolicy to be reused across writer close/open

Created: 21/Feb/08 05:20 PM   Updated: 11/Oct/08 12:49 PM
Return to search
Component/s: Index
Affects Version/s: 2.3
Fix Version/s: 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LUCENE-1184.patch 2008-02-21 05:23 PM Michael McCandless 9 kB

Lucene Fields: New
Resolution Date: 26/Feb/08 02:24 PM


 Description  « Hide
If you re-use the same instance of SnapshotDeletionPolicy across a
close/open of your writer, and you had a snapshot open, it can still
be removed when the 2nd writer is opened. This is because SDP is
comparing IndexCommitPoint instances.

The fix is to instead compare segments file names.

I've also changed the inner class IndexFileDeleter.CommitPoint to be
static so an instance of SnapshotDeletionPolicy does not hold
references to IndexFileDeleter, DocumentsWriter, etc.

Spinoff from here:

http://markmail.org/message/bojgqfgyxkkv4fyb



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Michael McCandless added a comment - 21/Feb/08 05:23 PM
Attached patch. I plan to commit in a day or two.

Michael McCandless made changes - 21/Feb/08 05:23 PM
Field Original Value New Value
Attachment LUCENE-1184.patch [ 12376136 ]
Repository Revision Date User Message
ASF #631223 Tue Feb 26 14:23:45 UTC 2008 mikemccand LUCENE-1184: allow SnapshotDeletionPolicy to be re-used across close/open of IndexWriter
Files Changed
MODIFY /lucene/java/trunk/src/java/org/apache/lucene/index/SnapshotDeletionPolicy.java
MODIFY /lucene/java/trunk/CHANGES.txt
MODIFY /lucene/java/trunk/src/test/org/apache/lucene/TestSnapshotDeletionPolicy.java
MODIFY /lucene/java/trunk/src/java/org/apache/lucene/index/IndexFileDeleter.java

Michael McCandless added a comment - 26/Feb/08 02:24 PM
I just committed this. Thanks Tim!

Michael McCandless made changes - 26/Feb/08 02:24 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Michael McCandless made changes - 11/Oct/08 12:49 PM
Status Resolved [ 5 ] Closed [ 6 ]