Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-7005

org.apache.lucene.index.IndexNotFoundException when querying

    XMLWordPrintable

Details

    • Hide

      Run test AffinityTopologyChangeTest in a loop, it will eventually fail (< 1% of the time).
      Although the test is for the AffinityIndexManager, it could happen on other index managers based on Infinispan Directory.

      Show
      Run test AffinityTopologyChangeTest in a loop, it will eventually fail (< 1% of the time). Although the test is for the AffinityIndexManager, it could happen on other index managers based on Infinispan Directory.

    Description

      This happens when querying an Index stored in the Infinispan directory at the same time writes are happening. It is very hard to reproduce, the stack trace is:

      java.util.concurrent.CompletionException: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'entity.205'
              at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
              at java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:280)
              at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1592)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
              at java.lang.Thread.run(Thread.java:745)
      Caused by: org.hibernate.search.exception.SearchException: HSEARCH000103: Unable to initialize IndexManager named 'entity.205'
              at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:275)
              at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:528)
              at org.hibernate.search.indexes.impl.IndexManagerHolder.getOrCreateIndexManager(IndexManagerHolder.java:163)
              at org.hibernate.search.engine.impl.DynamicShardingStrategy.getIndexManagersFromShards(DynamicShardingStrategy.java:82)
              at org.hibernate.search.engine.impl.DynamicShardingStrategy.getIndexManagersForQuery(DynamicShardingStrategy.java:71)
              at org.hibernate.search.query.engine.impl.LuceneHSQuery.getIndexManagers(LuceneHSQuery.java:611)
              at org.hibernate.search.query.engine.impl.LuceneHSQuery.buildSearcher(LuceneHSQuery.java:447)
              at org.hibernate.search.query.engine.impl.LuceneHSQuery.buildSearcher(LuceneHSQuery.java:380)
              at org.hibernate.search.query.engine.impl.LuceneHSQuery.queryEntityInfos(LuceneHSQuery.java:138)
              at org.infinispan.query.impl.CacheQueryImpl.list(CacheQueryImpl.java:161)
              at org.infinispan.query.affinity.AffinityTopologyChangeTest$QueryingNode.executeTask(AffinityTopologyChangeTest.java:164)
              at org.infinispan.query.affinity.AffinityTopologyChangeTest$TaskNode.lambda$null$0(AffinityTopologyChangeTest.java:129)
              at java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1590)
              ... 3 more
      Caused by: org.hibernate.search.exception.SearchException: Unable to open Lucene IndexReader for IndexManager entity.205
              at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.createReader(SharingBufferReaderProvider.java:113)
              at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.initialize(SharingBufferReaderProvider.java:91)
              at org.hibernate.search.indexes.impl.PropertiesParseHelper.createDirectoryBasedReaderProvider(PropertiesParseHelper.java:172)
              at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.createIndexReader(DirectoryBasedIndexManager.java:208)
              at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.initialize(DirectoryBasedIndexManager.java:87)
              at org.infinispan.query.affinity.AffinityIndexManager.initialize(AffinityIndexManager.java:139)
              at org.hibernate.search.indexes.impl.IndexManagerHolder.createIndexManager(IndexManagerHolder.java:271)
              ... 15 more
      Caused by: org.apache.lucene.index.IndexNotFoundException: no segments* file found in InfinispanDirectory{indexName='entity.205'}: files: [_0.cfe, _0.cfs, _0.si, pending_segments_2]
              at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:726)
              at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:50)
              at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:63)
              at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.readerFactory(SharingBufferReaderProvider.java:131)
              at org.hibernate.search.indexes.impl.SharingBufferReaderProvider$PerDirectoryLatestReader.<init>(SharingBufferReaderProvider.java:206)
              at org.hibernate.search.indexes.impl.SharingBufferReaderProvider.createReader(SharingBufferReaderProvider.java:108)
              ... 21 more
      

      Attachments

        Activity

          People

            gfernand@redhat.com Gustavo Fernandes
            gfernand@redhat.com Gustavo Fernandes
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: