Issue Details (XML | Word | Printable)

Key: LUCENE-1228
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Doron Cohen
Reporter: Doron Cohen
Votes: 0
Watchers: 0
Operations

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

IndexWriter.commit() does not update the index version

Created: 13/Mar/08 07:19 PM   Updated: 14/Mar/08 11:49 PM
Return to search
Component/s: Index
Affects Version/s: 2.4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works lucene-1228-commit-reopen.patch 2008-03-13 07:24 PM Doron Cohen 5 kB
Issue Links:
Reference
 

Lucene Fields: Patch Available
Resolution Date: 14/Mar/08 10:35 AM


 Description  « Hide
IndexWriter.commit() can update the index version and generation but the update of version is lost.
As result added documents are not seen by IndexReader.reopen().
(There might be other side effects that I am not aware of).
The fix is 1 line - update also the version in SegmentsInfo.updateGeneration().
(Finding this line involved more lines though... )

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Doron Cohen added a comment - 13/Mar/08 07:24 PM
Patch with a fix + a test that demonstrates the bug.
All core tests pass. Will run all tests later on.

Michael McCandless added a comment - 13/Mar/08 08:07 PM
Good catch Doron, thanks!

This only affects trunk (2.4).


Doron Cohen added a comment - 13/Mar/08 08:15 PM
Oh good, less migration to do.
Mmm.. so it is not related to Daniel's "Document ID shuffling under 2.3.x" in the user list.

Ning Li added a comment - 13/Mar/08 10:30 PM
Does SegmentInfos really need both "version" and "generation"? Is "generation" sufficient?

Michael McCandless added a comment - 14/Mar/08 08:30 AM

Does SegmentInfos really need both "version" and "generation"? Is "generation" sufficient?

I believe they are in fact redundant. I tested this with a small change to just return generation when getVersion is called and all tests pass. I'll open a new issue.


Doron Cohen added a comment - 14/Mar/08 10:35 AM
Committed.