Uploaded image for project: 'ModeShape'
  1. ModeShape
  2. MODE-1877

Errors when configuring ModeShape to store indexes in ISPN caches

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Blocker Blocker
    • None
    • 3.1.3.Final
    • None
    • None

      When configuring ModeShape & Hibernate Search to store indexes in Infinispan, the following exceptions can occur based on the various configurations of the indexing caches:

      Scenario 1
      ----------
      ISPN indexing configuration:

      <?xml version="1.0" encoding="UTF-8"?>
      <infinispan
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
              xmlns="urn:infinispan:config:5.2">
      
          <global>
              <globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
          </global>
      
          <namedCache name="ISPNIndexingRepo-index-lock">
              <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup" lockingMode="PESSIMISTIC"/>
          </namedCache>
          <namedCache name="ISPNIndexingRepo-index-data">
              <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup" lockingMode="PESSIMISTIC"/>
          </namedCache>
          <namedCache name="ISPNIndexingRepo-index-metadata">
              <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup" lockingMode="PESSIMISTIC"/>
          </namedCache>
      </infinispan>
      

      produces the following exception:

      18:59:05,063  INFO ISPN000128: Infinispan version: Infinispan 'Delirium' 5.2.1.Final
      18:59:06,219  INFO HSEARCH000034: Hibernate Search 4.2.0.Final
      18:59:06,246  INFO HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
      18:59:07,235 ERROR HSEARCH000058: Exception occurred java.io.IOException: Read past EOF
      Primary Failure:
      	Entity org.modeshape.jcr.query.lucene.basic.NodeInfo  Id b1e4867317f1e7mode:synchronizedInitialization  Work Type  org.hibernate.search.backend.AddLuceneWork
      Subsequent failures:
      	Entity org.modeshape.jcr.query.lucene.basic.NodeInfo  Id b1e4867317f1e7jcr:system  Work Type  org.hibernate.search.backend.UpdateLuceneWork
      
      java.io.IOException: Read past EOF
      	at org.infinispan.lucene.SingleChunkIndexInput.readByte(SingleChunkIndexInput.java:77)
      	at org.apache.lucene.store.ChecksumIndexInput.readByte(ChecksumIndexInput.java:41)
      	at org.apache.lucene.store.DataInput.readInt(DataInput.java:86)
      	at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:272)
      	at org.apache.lucene.index.SegmentInfos$1.doBody(SegmentInfos.java:363)
      	at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:709)
      	at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:554)
      	at org.apache.lucene.index.SegmentInfos.read(SegmentInfos.java:359)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1138)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      18:59:07,245 ERROR HSEARCH000072: Couldn't open the IndexWriter because of previous error: operation skipped, index ouf of sync!
      

      Scenario 2
      ----------
      ISPN indexing configuration:

      <?xml version="1.0" encoding="UTF-8"?>
      <infinispan
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="urn:infinispan:config:5.2 http://www.infinispan.org/schemas/infinispan-config-5.2.xsd"
              xmlns="urn:infinispan:config:5.2">
      
          <global>
              <globalJmxStatistics enabled="false" allowDuplicateDomains="true"/>
          </global>
      
      
          <default>
              <transaction transactionManagerLookupClass="org.infinispan.transaction.lookup.DummyTransactionManagerLookup" lockingMode="PESSIMISTIC"/>
          </default>
      
      
          <namedCache name="ISPNIndexingRepo-index-lock"/>
          <namedCache name="ISPNIndexingRepo-index-data"/>
          <namedCache name="ISPNIndexingRepo-index-metadata"/>
      </infinispan>
      

      produces:

      19:02:59,513  INFO HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
      19:03:10,402 ERROR ISPN000136: Execution error
      org.infinispan.util.concurrent.TimeoutException: Unable to acquire lock after [10 seconds] on key [write.lock|M|nodeinfo] for requestor [GlobalTransaction:<null>:24:local]! Lock held by [GlobalTransaction:<null>:21:local]
      	at org.infinispan.util.concurrent.locks.LockManagerImpl.lock(LockManagerImpl.java:213)
      	at org.infinispan.util.concurrent.locks.LockManagerImpl.acquireLock(LockManagerImpl.java:186)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.lockKeyAndCheckOwnership(AbstractTxLockingInterceptor.java:186)
      	at org.infinispan.interceptors.locking.PessimisticLockingInterceptor.visitPutKeyValueCommand(PessimisticLockingInterceptor.java:122)
      	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
      	at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:62)
      	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.TxInterceptor.enlistWriteAndInvokeNext(TxInterceptor.java:251)
      	at org.infinispan.interceptors.TxInterceptor.visitPutKeyValueCommand(TxInterceptor.java:191)
      	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:128)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:92)
      	at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:62)
      	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:77)
      	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:343)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1162)
      	at org.infinispan.CacheImpl.putIfAbsentInternal(CacheImpl.java:779)
      	at org.infinispan.CacheImpl.putIfAbsent(CacheImpl.java:771)
      	at org.infinispan.DecoratedCache.putIfAbsent(DecoratedCache.java:355)
      	at org.infinispan.lucene.locking.BaseLuceneLock.obtain(BaseLuceneLock.java:63)
      	at org.apache.lucene.store.Lock.obtain(Lock.java:72)
      	at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:148)
      	at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:115)
      	at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:117)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99)
      	at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67)
      	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      	at java.lang.Thread.run(Thread.java:662)
      

              Unassigned Unassigned
              hchiorean Horia Chiorean (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: