lucene-dev mailing list archives

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

                 Key: LUCENE-1691
             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:

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$

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