org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock

JIRA | Nico Krijnen | 6 years ago
  1. 0

    We have a system running lucene and zoie. We use lucene as a content store for a CMS/DAM system. We use the hot-backup feature of zoie to make scheduled backups of the index. This works fine for small indexes and when there are not a lot of changes to the index when the backup is made. On large indexes (about 5 GB to 19 GB), when a backup is made while the index is being changed a lot (lots of document additions and/or deletions), we almost always get a 'read past EOF' at some point, followed by lots of 'Lock obtain timed out'. At that point we get lots of 0 kb files in the index, data gets lots, and the index is unusable. When we stop our server, remove the 0kb files and restart our server, the index is operational again, but data has been lost. I'm not sure if this is a zoie or a lucene issue, so i'm posting it to both. Hopefully someone has some ideas where to look to fix this. Some more details... Stack trace of the read past EOF and following Lock obtain timed out: {code} 78307 [proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader@31ca5085] ERROR proj.zoie.impl.indexing.internal.BaseSearchIndex - read past EOF java.io.IOException: read past EOF at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:154) at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:39) at org.apache.lucene.store.ChecksumIndexInput.readByte(ChecksumIndexInput.java:37) at org.apache.lucene.store.IndexInput.readInt(IndexInput.java:69) at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:245) at org.apache.lucene.index.IndexFileDeleter.<init>(IndexFileDeleter.java:166) at org.apache.lucene.index.DirectoryReader.doCommit(DirectoryReader.java:725) at org.apache.lucene.index.IndexReader.commit(IndexReader.java:987) at org.apache.lucene.index.IndexReader.commit(IndexReader.java:973) at org.apache.lucene.index.IndexReader.decRef(IndexReader.java:162) at org.apache.lucene.index.IndexReader.close(IndexReader.java:1003) at proj.zoie.impl.indexing.internal.BaseSearchIndex.deleteDocs(BaseSearchIndex.java:203) at proj.zoie.impl.indexing.internal.BaseSearchIndex.loadFromIndex(BaseSearchIndex.java:223) at proj.zoie.impl.indexing.internal.LuceneIndexDataLoader.loadFromIndex(LuceneIndexDataLoader.java:153) at proj.zoie.impl.indexing.internal.DiskLuceneIndexDataLoader.loadFromIndex(DiskLuceneIndexDataLoader.java:134) at proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader.processBatch(RealtimeIndexDataLoader.java:171) at proj.zoie.impl.indexing.internal.BatchedIndexDataLoader$LoaderThread.run(BatchedIndexDataLoader.java:373) 579336 [proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader@31ca5085] ERROR proj.zoie.impl.indexing.internal.LuceneIndexDataLoader - Problem copying segments: Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock at org.apache.lucene.store.Lock.obtain(Lock.java:84) at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1060) at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:957) at proj.zoie.impl.indexing.internal.DiskSearchIndex.openIndexWriter(DiskSearchIndex.java:176) at proj.zoie.impl.indexing.internal.BaseSearchIndex.loadFromIndex(BaseSearchIndex.java:228) at proj.zoie.impl.indexing.internal.LuceneIndexDataLoader.loadFromIndex(LuceneIndexDataLoader.java:153) at proj.zoie.impl.indexing.internal.DiskLuceneIndexDataLoader.loadFromIndex(DiskLuceneIndexDataLoader.java:134) at proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader.processBatch(RealtimeIndexDataLoader.java:171) at proj.zoie.impl.indexing.internal.BatchedIndexDataLoader$LoaderThread.run(BatchedIndexDataLoader.java:373) {code} We get exactly the same behavour on both OS X and on Windows. On both zoie is using a SimpleFSDirectory. We also use a SingleInstanceLockFactory (since our process is the only one working with the index), but we get the same behaviour with a NativeFSLock. The snapshot backup is being made by calling: *proj.zoie.impl.indexing.ZoieSystem.exportSnapshot(WritableByteChannel)* Same issue in lucene JIRA: https://issues.apache.org/jira/browse/LUCENE-2729

    JIRA | 6 years ago | Nico Krijnen
    org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock
  2. 0

    We have a system running lucene and zoie. We use lucene as a content store for a CMS/DAM system. We use the hot-backup feature of zoie to make scheduled backups of the index. This works fine for small indexes and when there are not a lot of changes to the index when the backup is made. On large indexes (about 5 GB to 19 GB), when a backup is made while the index is being changed a lot (lots of document additions and/or deletions), we almost always get a 'read past EOF' at some point, followed by lots of 'Lock obtain timed out'. At that point we get lots of 0 kb files in the index, data gets lots, and the index is unusable. When we stop our server, remove the 0kb files and restart our server, the index is operational again, but data has been lost. I'm not sure if this is a zoie or a lucene issue, so i'm posting it to both. Hopefully someone has some ideas where to look to fix this. Some more details... Stack trace of the read past EOF and following Lock obtain timed out: {code} 78307 [proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader@31ca5085] ERROR proj.zoie.impl.indexing.internal.BaseSearchIndex - read past EOF java.io.IOException: read past EOF at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:154) at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:39) at org.apache.lucene.store.ChecksumIndexInput.readByte(ChecksumIndexInput.java:37) at org.apache.lucene.store.IndexInput.readInt(IndexInput.java:69) at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:245) at org.apache.lucene.index.IndexFileDeleter.<init>(IndexFileDeleter.java:166) at org.apache.lucene.index.DirectoryReader.doCommit(DirectoryReader.java:725) at org.apache.lucene.index.IndexReader.commit(IndexReader.java:987) at org.apache.lucene.index.IndexReader.commit(IndexReader.java:973) at org.apache.lucene.index.IndexReader.decRef(IndexReader.java:162) at org.apache.lucene.index.IndexReader.close(IndexReader.java:1003) at proj.zoie.impl.indexing.internal.BaseSearchIndex.deleteDocs(BaseSearchIndex.java:203) at proj.zoie.impl.indexing.internal.BaseSearchIndex.loadFromIndex(BaseSearchIndex.java:223) at proj.zoie.impl.indexing.internal.LuceneIndexDataLoader.loadFromIndex(LuceneIndexDataLoader.java:153) at proj.zoie.impl.indexing.internal.DiskLuceneIndexDataLoader.loadFromIndex(DiskLuceneIndexDataLoader.java:134) at proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader.processBatch(RealtimeIndexDataLoader.java:171) at proj.zoie.impl.indexing.internal.BatchedIndexDataLoader$LoaderThread.run(BatchedIndexDataLoader.java:373) 579336 [proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader@31ca5085] ERROR proj.zoie.impl.indexing.internal.LuceneIndexDataLoader - Problem copying segments: Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock at org.apache.lucene.store.Lock.obtain(Lock.java:84) at org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1060) at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:957) at proj.zoie.impl.indexing.internal.DiskSearchIndex.openIndexWriter(DiskSearchIndex.java:176) at proj.zoie.impl.indexing.internal.BaseSearchIndex.loadFromIndex(BaseSearchIndex.java:228) at proj.zoie.impl.indexing.internal.LuceneIndexDataLoader.loadFromIndex(LuceneIndexDataLoader.java:153) at proj.zoie.impl.indexing.internal.DiskLuceneIndexDataLoader.loadFromIndex(DiskLuceneIndexDataLoader.java:134) at proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader.processBatch(RealtimeIndexDataLoader.java:171) at proj.zoie.impl.indexing.internal.BatchedIndexDataLoader$LoaderThread.run(BatchedIndexDataLoader.java:373) {code} We get exactly the same behavour on both OS X and on Windows. On both zoie is using a SimpleFSDirectory. We also use a SingleInstanceLockFactory (since our process is the only one working with the index), but we get the same behaviour with a NativeFSLock. The snapshot backup is being made by calling: *proj.zoie.impl.indexing.ZoieSystem.exportSnapshot(WritableByteChannel)* Same issue in lucene JIRA: https://issues.apache.org/jira/browse/LUCENE-2729

    JIRA | 6 years ago | Nico Krijnen
    org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock
  3. 0

    Problem with File Locks after running for a while

    GitHub | 6 years ago | ldriscoll
    org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/data/lucene/f62f4dd4-1f33-438f-8d40-13ba71f8e338/b629s4iybvcuwt0uwhxyw0jzc/write.lock
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unicode index names causing DELETE index to hang

    GitHub | 2 years ago | clintongormley
    org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/Users/clinton/workspace/elasticsearch/data/elasticsearch/nodes/0/indices/test-weird-index-??/2/index/write.lock
  6. 0

    Error on initializing Lucene index

    GitHub | 2 years ago | vitorenesduarte
    org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: NativeFSLock@/Users/vitorenes/home/progs/orientdb-community-2.0.4/databases/Demo/luceneIndexes/UserLUCENE/write.lock

    3 unregistered visitors
    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. org.apache.lucene.store.LockObtainFailedException

      Lock obtain timed out: org.apache.lucene.store.SingleInstanceLock@5ad0b895: write.lock

      at org.apache.lucene.store.Lock.obtain()
    2. Lucene
      IndexWriter.<init>
      1. org.apache.lucene.store.Lock.obtain(Lock.java:84)
      2. org.apache.lucene.index.IndexWriter.init(IndexWriter.java:1060)
      3. org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:957)
      3 frames
    3. proj.zoie.impl
      BatchedIndexDataLoader$LoaderThread.run
      1. proj.zoie.impl.indexing.internal.DiskSearchIndex.openIndexWriter(DiskSearchIndex.java:176)
      2. proj.zoie.impl.indexing.internal.BaseSearchIndex.loadFromIndex(BaseSearchIndex.java:228)
      3. proj.zoie.impl.indexing.internal.LuceneIndexDataLoader.loadFromIndex(LuceneIndexDataLoader.java:153)
      4. proj.zoie.impl.indexing.internal.DiskLuceneIndexDataLoader.loadFromIndex(DiskLuceneIndexDataLoader.java:134)
      5. proj.zoie.impl.indexing.internal.RealtimeIndexDataLoader.processBatch(RealtimeIndexDataLoader.java:171)
      6. proj.zoie.impl.indexing.internal.BatchedIndexDataLoader$LoaderThread.run(BatchedIndexDataLoader.java:373)
      6 frames