Issue Details (XML | Word | Printable)

Key: LUCENE-1173
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Michael McCandless
Reporter: Yonik Seeley
Votes: 3
Watchers: 3
Operations

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

index corruption autoCommit=false

Created: 11/Feb/08 09:11 PM   Updated: 24/Feb/08 12:40 AM
Return to search
Component/s: Index
Affects Version/s: 2.3
Fix Version/s: 2.3.1, 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works indexstress.patch 2008-02-11 10:18 PM Yonik Seeley 12 kB
Text File Licensed for inclusion in ASF works indexstress.patch 2008-02-11 09:17 PM Yonik Seeley 11 kB
Text File Licensed for inclusion in ASF works LUCENE-1173.patch 2008-02-11 11:12 PM Michael McCandless 12 kB
Issue Links:
Blocker
 

Lucene Fields: New
Resolution Date: 14/Feb/08 03:28 PM


 Description  « Hide
In both Lucene 2.3 and trunk, the index becomes corrupted when autoCommit=false

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Yonik Seeley added a comment - 11/Feb/08 09:17 PM
Attaching a patch that can reproduce.
With autoCommit=true, the test passes. Change it to false and it fails.

The test basic uses multiple threads to update documents. The last document for any id is kept, and then all these docs are indexed again serially. The two indicies are them compared.


Yonik Seeley added a comment - 11/Feb/08 09:21 PM
Note: if I reduce the test to indexing with a single thread, it still fails.
Map docs = indexRandom(1, 50, 50, dir1);
The test still does the indexing in a different thread than the close(), so it's not quite a single threaded test.

Another thing to note: all of the terms are matching up (the test succeeds if I don't test the stored fields).


Michael McCandless added a comment - 11/Feb/08 09:23 PM
Uh oh ... I'll take this!

Yonik Seeley added a comment - 11/Feb/08 10:18 PM
Thanks Mike!

Attaching new version of test that correctly deals with terms with no docs (because of deletions).
Other variations were failing before, now it's just those with autoCommit=false

Note that it's possible to trigger this bug by indexing only 3 documents:
mergeFactor=2; maxBufferedDocs=2; Map docs = indexRandom(1, 3, 2, dir1);

I love random testing


Michael McCandless added a comment - 11/Feb/08 10:26 PM
Yes this is one awesome test case

Thanks.


Michael McCandless added a comment - 11/Feb/08 11:12 PM
I just sent email to java-user to give a heads up on this.

Attach patch fixes the issue. All tests pass.

I think we should spin 2.3.1 for this one?


Yonik Seeley added a comment - 11/Feb/08 11:25 PM
Patch looks good (heh... a one liner!)
At least it won't break previously working code since autoCommit=true is the default. The only risk is people trying out the new setting and not realizing it can break things.
2.3.1 might be nice, but I'll leave to others (who have the actual time to do the work) to decide.

Yonik Seeley added a comment - 11/Feb/08 11:44 PM
Hold up a bit... my random testing may have hit another bug....
testMultiConfig hit an error at some point when I cranked up the iterations... I'm trying to reproduce.

Michael McCandless added a comment - 12/Feb/08 11:13 AM

Backported to 2.3.

Patch looks good (heh... a one liner!)

Yeah the worst ones always seem to be one-liner fixes. Sigh.

Hold up a bit... my random testing may have hit another bug....
testMultiConfig hit an error at some point when I cranked up the iterations... I'm trying to reproduce.

I'll go dig on that one next.


Michael McCandless added a comment - 14/Feb/08 03:28 PM
Committed to 2.3 & trunk.