Yajun wrote:

YL>> The lucene library comes with Solr. The jar file is
lucene-core-2007-05-20_00-04-53.jar. I compared the source code of
IndexReader which is close to Lucene 2.2, not 2.1

Hmmm OK thanks.

This part is odd:

When this happen, the program automatically tried to reopen the most
recent THREE snapshots and we got the same exception for each
snapshot. Remember, each of the snapshot was validated before it was
copied.

If I understand the steps correctly, once and index is created,
verified (by opening an IndexReader) and copied up to a snapshot, that
snapshot is never changed by Lucene (opened by an IndexWriter, or
IndexReader that does delete/setNorm)?  Yet somehow all 3 become
corrupt at the same time (that exception is hit when opening an
IndexReader)?

YL>> That's correct. Here is the sudo code of taking a snapshot:
   create a tmp directory /var/tmp/snapshot_timestamp
   int rety = 0;
   while (retry++ < 10) {
        copy index to /var/tmp/snapshot_timestamp
        try {
            IndexReader reader =
IndexReader.open(/var/tmp/snapshot_timestamp/index);
            reader.close();
        } catch (IOException e) {
            delete /var/tmp/snapshot_timestamp/index
            continue;
        }
    }

Did you say IndexReader also does delete? If that is the case, then the snapshot that is "validated" by IndexReader could be "invalidated" by this
deletion. That could explain all the snapshots become corrupted.

IndexReader only does deletes if you use the deleteDocument or setNorm methods. Are you using these? If not, then I think there must be something outside of Lucene causing this because IndexReader won't make any changes to an index otherwise.

It's very strange that all of your snapshots suddenly become unusable at the same time.

Are your snapshots complete copies, ie, there are no hard or soft links in them?

Mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to