Hi,

In my setup, I have several Lucene indexes configured with
"persistence=file" to store the files locally.
For some reason, after a while creating many nodes in the repository, I
suddenly get this kind of exception:

2018-06-26 23:22:27.850  WARN 3655 --- [ex-update-async]
o.a.j.o.plugins.index.AsyncIndexUpdate   : [async] The index update failed

org.apache.jackrabbit.oak.api.CommitFailedException: OakLucene0003: Failed
to index the node /path/to/the/node
    at
org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.addOrUpdate(LuceneIndexEditor.java:262)
~[oak-lucene-1.9.4.jar:1.9.4]
    at
org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.leave(LuceneIndexEditor.java:140)
~[oak-lucene-1.9.4.jar:1.9.4]
...
Caused by: java.io.FileNotFoundException: /path/to/index/directory/_2s.si
(No such file or directory)
    at java.io.RandomAccessFile.open0(Native Method) ~[na:1.8.0_171]
    at java.io.RandomAccessFile.open(RandomAccessFile.java:316)
~[na:1.8.0_171]
    at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243)
~[na:1.8.0_171]
...

(Full stack trace as attachment.)

At the moment of this exception, here's the list of files present in this
index directory:
_2y.cfe  _2y.cfs  _2y.fdt  _2y.fdx  _2y.fnm  _2y_Lucene41_0.doc
_2y_Lucene41_0.tim  _2y_Lucene41_0.tip  _2y_Lucene45_0.dvd
_2y_Lucene45_0.dvm  _2y.si  segments_2q  segments.gen

And I can't open the index with Luke, as it also complains about a missing
"_2s.si" file.
Strangely enough, other indexes with an almost identical definition don't
end up with this problem.

So what could be reason why this particular index got corrupted?
It is always reproduceable from a brand new repository.
I'm using Oak 1.9.4 with MongoDB.

Thanks.

-- 
Damiano Albani
2018-06-26 23:22:27.850  WARN 3655 --- [ex-update-async] o.a.j.o.plugins.index.AsyncIndexUpdate   : [async] The index update failed

org.apache.jackrabbit.oak.api.CommitFailedException: OakLucene0003: Failed to index the node /path/to/node
	at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.addOrUpdate(LuceneIndexEditor.java:262) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.leave(LuceneIndexEditor.java:140) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.CompositeEditor.leave(CompositeEditor.java:74) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.VisibleEditor.leave(VisibleEditor.java:60) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeAdded(EditorDiff.java:130) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer$1.childNodeChanged(JsopNodeStateDiffer.java:74) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DiffCache.parseJsopDiff(DiffCache.java:120) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compare(JsopNodeStateDiffer.java:52) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.compare(DocumentNodeStore.java:1768) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState.compareAgainstBaseState(AbstractDocumentNodeState.java:114) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compareExisting(JsopNodeStateDiffer.java:101) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.access$000(JsopNodeStateDiffer.java:28) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer$1.childNodeChanged(JsopNodeStateDiffer.java:66) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DiffCache.parseJsopDiff(DiffCache.java:120) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compare(JsopNodeStateDiffer.java:52) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.compare(DocumentNodeStore.java:1768) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState.compareAgainstBaseState(AbstractDocumentNodeState.java:114) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compareExisting(JsopNodeStateDiffer.java:101) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.access$000(JsopNodeStateDiffer.java:28) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer$1.childNodeChanged(JsopNodeStateDiffer.java:66) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DiffCache.parseJsopDiff(DiffCache.java:120) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compare(JsopNodeStateDiffer.java:52) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.compare(DocumentNodeStore.java:1768) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState.compareAgainstBaseState(AbstractDocumentNodeState.java:114) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compareExisting(JsopNodeStateDiffer.java:101) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.access$000(JsopNodeStateDiffer.java:28) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer$1.childNodeChanged(JsopNodeStateDiffer.java:66) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DiffCache.parseJsopDiff(DiffCache.java:120) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compare(JsopNodeStateDiffer.java:52) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.compare(DocumentNodeStore.java:1768) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState.compareAgainstBaseState(AbstractDocumentNodeState.java:114) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compareExisting(JsopNodeStateDiffer.java:101) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.access$000(JsopNodeStateDiffer.java:28) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer$1.childNodeChanged(JsopNodeStateDiffer.java:66) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DiffCache.parseJsopDiff(DiffCache.java:120) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compare(JsopNodeStateDiffer.java:52) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.compare(DocumentNodeStore.java:1768) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState.compareAgainstBaseState(AbstractDocumentNodeState.java:114) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compareExisting(JsopNodeStateDiffer.java:101) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.access$000(JsopNodeStateDiffer.java:28) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer$1.childNodeChanged(JsopNodeStateDiffer.java:66) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DiffCache.parseJsopDiff(DiffCache.java:120) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compare(JsopNodeStateDiffer.java:52) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.compare(DocumentNodeStore.java:1768) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState.compareAgainstBaseState(AbstractDocumentNodeState.java:114) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.childNodeChanged(EditorDiff.java:148) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compareExisting(JsopNodeStateDiffer.java:101) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.access$000(JsopNodeStateDiffer.java:28) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer$1.childNodeChanged(JsopNodeStateDiffer.java:66) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DiffCache.parseJsopDiff(DiffCache.java:120) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.JsopNodeStateDiffer.compare(JsopNodeStateDiffer.java:52) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.DocumentNodeStore.compare(DocumentNodeStore.java:1768) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.document.AbstractDocumentNodeState.compareAgainstBaseState(AbstractDocumentNodeState.java:114) ~[oak-store-document-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.spi.commit.EditorDiff.process(EditorDiff.java:52) ~[oak-store-spi-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.updateIndex(AsyncIndexUpdate.java:727) [oak-core-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.runWhenPermitted(AsyncIndexUpdate.java:572) [oak-core-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.index.AsyncIndexUpdate.run(AsyncIndexUpdate.java:431) [oak-core-1.9.4.jar:1.9.4]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_171]
	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_171]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_171]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_171]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_171]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_171]
	at java.lang.Thread.run(Thread.java:748) [na:1.8.0_171]
Caused by: java.io.FileNotFoundException: /path/to/index/directory/_2s.si (No such file or directory)
	at java.io.RandomAccessFile.open0(Native Method) ~[na:1.8.0_171]
	at java.io.RandomAccessFile.open(RandomAccessFile.java:316) ~[na:1.8.0_171]
	at java.io.RandomAccessFile.<init>(RandomAccessFile.java:243) ~[na:1.8.0_171]
	at org.apache.lucene.store.MMapDirectory.openInput(MMapDirectory.java:193) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.lucene.codecs.lucene46.Lucene46SegmentInfoReader.read(Lucene46SegmentInfoReader.java:49) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:340) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:404) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:843) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:694) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:400) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:746) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.index.lucene.writer.DefaultIndexWriter.getWriter(DefaultIndexWriter.java:153) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.index.lucene.writer.DefaultIndexWriter.updateDocument(DefaultIndexWriter.java:85) ~[oak-lucene-1.9.4.jar:1.9.4]
	at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndexEditor.addOrUpdate(LuceneIndexEditor.java:258) ~[oak-lucene-1.9.4.jar:1.9.4]
	... 68 common frames omitted

Reply via email to