Issue Details (XML | Word | Printable)

Key: LUCENE-1191
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

If IndexWriter hits OutOfMemoryError it should not commit

Created: 25/Feb/08 09:25 PM   Updated: 08/May/08 07:47 PM
Return to search
Component/s: Index
Affects Version/s: 1.9, 2.0.0, 2.1, 2.2, 2.3, 2.3.1, 2.4
Fix Version/s: 2.3.2, 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works LUCENE-1191.patch 2008-02-25 09:26 PM Michael McCandless 26 kB

Lucene Fields: New
Resolution Date: 28/Feb/08 09:35 PM


 Description  « Hide
While progress has been made making IndexWriter robust to OOME, I
think there is still a real risk that an OOME at a bad time could put
IndexWriter into a bad state such that if close() is called and
somehow it succeeds without hitting another OOME, it risks
introducing messing up the index.

I'd like to detect if OOME has been hit in any of the methods that
alter IW's state, and if so, do not commit changes to the index. If
close is called after hitting OOME, I think writer should instead
abort.

Attached patch just adds try/catch clauses to catch OOME, note that
it was hit, and re-throw it. Then, sync() refuses to commit a new
segments_N if OOME was hit, and close instead calls abort when OOME
was hit. All tests pass. I plan to commit in a day or two.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #632124 Thu Feb 28 21:35:42 UTC 2008 mikemccand LUCENE-1191: if we hit OOM then don't commit any changes to the index
Files Changed
MODIFY /lucene/java/trunk/src/java/org/apache/lucene/index/IndexWriter.java

Repository Revision Date User Message
ASF #635861 Tue Mar 11 09:51:15 UTC 2008 mikemccand LUCENE-1191 (porting to 2.3): on hitting OOME do not commit further changes to the index
Files Changed
MODIFY /lucene/java/branches/lucene_2_3/src/java/org/apache/lucene/index/IndexWriter.java
MODIFY /lucene/java/branches/lucene_2_3/CHANGES.txt