[
https://issues.apache.org/jira/browse/LUCENE-2523?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Uwe Schindler updated LUCENE-2523:
----------------------------------
Attachment: LUCENE-2523.patch
The final patch:
- I streamlined the exceptions. The ctor tooks filename, actual format version
and min/max. The message is then generated in the exception ctor and looks
identical everywhere in the code. Where the filename is not available, it is
left out (null). Maybe we should add the filename to CodecUtils, to be able to
display it on errors. This helps finding out, which file has wrong header. Or
is there a way to get file name from IndexInput?
- I keep the segments.gen version check disabled, this seems to be needed on
windows, to be able to retry.
I will commit soon!
> if index is too old you should hit an exception saying so
> ---------------------------------------------------------
>
> Key: LUCENE-2523
> URL: https://issues.apache.org/jira/browse/LUCENE-2523
> Project: Lucene - Java
> Issue Type: Bug
> Components: Index
> Reporter: Michael McCandless
> Assignee: Uwe Schindler
> Priority: Minor
> Fix For: 4.0
>
> Attachments: LUCENE-2523.patch, LUCENE-2523.patch, LUCENE-2523.patch,
> LUCENE-2523.patch, LUCENE-2523.patch, LUCENE-2523.patch
>
>
> If you create an index in 2.3.x (I used demo's IndexFiles) and then try to
> read it in 4.0.x (I used CheckIndex), you hit a confusing exception like this:
> {noformat}
> java.io.IOException: read past EOF
> at
> org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:154)
> at
> org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:39)
> at
> org.apache.lucene.store.ChecksumIndexInput.readByte(ChecksumIndexInput.java:40)
> at org.apache.lucene.store.DataInput.readInt(DataInput.java:76)
> at org.apache.lucene.index.SegmentInfo.<init>(SegmentInfo.java:171)
> at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:230)
> at
> org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:269)
> at
> org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:649)
> at
> org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:484)
> at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:265)
> at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:308)
> at org.apache.lucene.index.CheckIndex.checkIndex(CheckIndex.java:287)
> at org.apache.lucene.index.CheckIndex.main(CheckIndex.java:930)
> {noformat}
> I think instead we should throw an IndexTooOldException or something like
> that?
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]