I'm working with/on a database system that uses Lucene for full text
indexes (currently using 7.3.0).
We're encountering occasional problems that occur after unclean shutdowns
of the database , resulting in
"org.apache.lucene.index.CorruptIndexException: file mismatch" errors when
the IndexWriter is constructed.

In all of the cases this has occurred, CheckIndex finds no issues with the
Lucene index.

The database has write-ahead-log and recovery facilities, so making the
Lucene indexes durable wrt database operations is doable, but in this case
the IndexWriter itself is failing to initialise, so it looks like there
needs to be a lower-level validation/recovery operation before reconciling
transactions can take place.

Can anyone provide any advice about how the database can detect and recover
from this situation?

thanks
Tim
---

Relevant parts of the exception:

org.apache.lucene.index.CorruptIndexException: file mismatch, expected
id=e673n8syolqg0phzxvw8d7czu, got=dwpa40yzwp7gf06xibrsx1pn2
(resource=BufferedChecksumIndexInput(MMapIndexInput(path="/databases/xxxx/luceneIndexes/SearchNameIx/_
8x.si")))
at org.apache.lucene.codecs.CodecUtil.checkIndexHeaderID(CodecUtil.java:351)
at org.apache.lucene.codecs.CodecUtil.checkIndexHeader(CodecUtil.java:256)
at
org.apache.lucene.codecs.lucene70.Lucene70SegmentInfoFormat.read(Lucene70SegmentInfoFormat.java:95)
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:360)
at org.apache.lucene.index.SegmentInfos.readCommit(SegmentInfos.java:290)
at
org.apache.lucene.index.IndexFileDeleter.<init>(IndexFileDeleter.java:165)
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1121)
------------------ 8< --------------------------

Reply via email to