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

InfinispanIndexManager locks held when primary node change

XMLWordPrintable

      Given the following configuration:

      <cache-container name="store" default-cache="default" statistics="true">
              <transport cluster="Infinispan-Query-Cluster"/>
              <!-- *************************************** -->
              <!--  Default Cache, with indexing enabled.  -->
              <!-- *************************************** -->
              <replicated-cache name="passivation" mode="SYNC" remote-timeout="20000" statistics="true">
                  <indexing index="LOCAL">
                      <property name="hibernate.search.default.indexmanager">
                          org.infinispan.query.indexmanager.InfinispanIndexManager
                      </property>
                      <property name="hibernate.search.default.directory_provider">infinispan</property>
                  </indexing>
              </replicated-cache>
      
              <replicated-cache name="LuceneIndexesMetadata" mode="SYNC" remote-timeout="25000">
                  <indexing index="NONE"/>
              </replicated-cache>
      
              <distributed-cache name="LuceneIndexesData" mode="SYNC" remote-timeout="25000">
                  <indexing index="NONE"/>
              </distributed-cache>
              <replicated-cache name="LuceneIndexesLocking" mode="SYNC" remote-timeout="25000">
                  <indexing index="NONE"/>
              </replicated-cache>
          </cache-container>
      

      Scenario:

      • Start Node 1
      • Insert a few @Indexed objects in the cache
      • Start Node 2
      • Insert a few @Indexed objects in the cache

      Node 2 cannot acquire the locks to write and throws errors:

      org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask applyUpdates
      ERROR: HSEARCH000072: Couldn't open the IndexWriter because of previous error: operation skipped, index ouf of sync!
      Aug 01, 2014 4:48:23 PM org.hibernate.search.exception.impl.LogErrorHandler handleException
      ERROR: HSEARCH000058: Exception occurred org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.infinispan.lucene.locking.BaseLuceneLock@2c1e889f
      

      During the insertion on Node1, the InfinispanCommandsBackend elects Node 1 as the primary node (since it's the only one) and acquires the lock on the LuceneIndexesLocking.
      When node 2 joins and the topology changes, the InfinispanCommandsBackend elects Node 2 as the primary node, but it fails to acquire the lock (held by Node 1)

              sgrinove Sanne Grinovero (Inactive)
              gfernand@redhat.com Gustavo Fernandes (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: