lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] Commented: (LUCENE-1691) An index copied over another index can result in corruption
Date Mon, 15 Jun 2009 10:53:07 GMT


Michael McCandless commented on LUCENE-1691:

Copying over an existing index, without first removing all files in that index, is not a supported
use case for Lucene.

Ie, to restore from backup you should make an empty dir and copy back your index files.

> An index copied over another index can result in corruption
> -----------------------------------------------------------
>                 Key: LUCENE-1691
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Store
>            Reporter: Adrian Hempel
>            Priority: Minor
>             Fix For: 2.4.1
> After restoring an older backup of an index over the top of a newer version of the index,
attempts to open the index can result in CorruptIndexExceptions, such as:
> {noformat}
> Caused by: org.apache.lucene.index.CorruptIndexException: doc counts differ for segment
_ed: fieldsReader shows 1137 but segmentInfo shows 1389
>     at org.apache.lucene.index.SegmentReader.initialize(
>     at org.apache.lucene.index.SegmentReader.get(
>     at org.apache.lucene.index.SegmentReader.get(
>     at org.apache.lucene.index.MultiSegmentReader.<init>(
>     at org.apache.lucene.index.ReadOnlyMultiSegmentReader.<init>(
>     at org.apache.lucene.index.DirectoryIndexReader$1.doBody(
>     at org.apache.lucene.index.SegmentInfos$
>     at
>     at
>     at
> {noformat}
> The apparent cause is the strategy of taking the maximum of the ID in the segments.gen
file, and the IDs of the apparently valid segment files (See lines 523-593 [here|]),
and using this as the current generation of the index.  This will include "stale" segments
that existed before the backup was restored.

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:
For additional commands, e-mail:

View raw message