You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Hoss Man (JIRA)" <ji...@apache.org> on 2011/04/20 22:16:05 UTC

[jira] [Commented] (LUCENE-3008) NumberFormatException: For input string: "gen.before_restore_2011-03-21_07.15.36.372112"

    [ https://issues.apache.org/jira/browse/LUCENE-3008?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13022348#comment-13022348 ] 

Hoss Man commented on LUCENE-3008:
----------------------------------

it appears that maybe someone attempted to "backup" the segments file in an index directory by copying it to a new filename with an extension (".before_restore_2011-03-21_07.15.36.372112") and this confused the SegmentInfos code into thinking that extension was the segment generation number.

in general, this is a no-no on the users part -- you shouldn't muck with the file names in an index directory (but you can copy the entire directory to your hearts content)

that said, we should probably consider hardening SegmentInfos.getCurrentSegmentGeneration to be more strict about which "segment*" files it's willing to consider candidates for the current generation.

at worst: we should wrap the NumberFormatException in something more useful.

> NumberFormatException: For input string: "gen.before_restore_2011-03-21_07.15.36.372112"
> ----------------------------------------------------------------------------------------
>
>                 Key: LUCENE-3008
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3008
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>            Reporter: Tran Nam Quang
>
> Hello,
> One of our users reported the following stacktrace:
> Exception in thread "Thread-3" java.lang.NumberFormatException: For input string: "gen.before_restore_2011-03-21_07.15.36.372112"
> at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
> at java.lang.Long.parseLong(Long.java:419)
> at org.apache.lucene.index.SegmentInfos.generationFromSegmentsFileName(SegmentInfos.java:199)
> at org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(SegmentInfos.java:134)
> at org.apache.lucene.index.SegmentInfos.getCurrentSegmentGeneration(SegmentInfos.java:151)
> at org.apache.lucene.index.IndexReader.indexExists(IndexReader.java:626)
> at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1015)
> at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:887)
> at net.sourceforge.docfetcher.model.RootScope.updateIndex(RootScope.java:138)
> at net.sourceforge.docfetcher.model.ScopeRegistry$2.run(ScopeRegistry.java:392)
> I'm afraid I can't provide any more information than this, other than the Lucene version: 3.0.0
> Best regards
> Tran Nam Quang

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org