Hi all,
we have been using Hibernate Search for quite a while now and are very happy about its easy of use. Recently we have been looking into preparing our application for a load balanced setup. We are running on Amazon Web Services (AWS) and our configuration for all instances of the application is identical. We thought that a master / slave setup was therefore unsuitable (at least until the auto detection / master election is available) and we choose to try the Infinispan approach. We use the default Infinispan configuration with a custom JGroups configuration (JDBC_PING) file to setup the cluster. The cluster seems to form correctly since the index from the first server becomes available on the second server that starts. Changes from the first server also become direct available on the second server. However, if I try to change something on the second server an exception occurs:
Code:
ERROR 11:39:44.296 default o.h.s.exception.impl.LogErrorHandler - HSEARCH000058: Exception occurred org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.infinispan.lucene.locking.BaseLuceneLock@2a10b73d
Primary Failure:
Entity nl.usmedia.domain.model.Entity Id 403071 Work Type org.hibernate.search.backend.AddLuceneWork
org.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: org.infinispan.lucene.locking.BaseLuceneLock@2a10b73d
at org.apache.lucene.store.Lock.obtain(Lock.java:84) ~[lucene-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:46:51]
at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1108) ~[lucene-core-3.5.0.jar:3.5.0 1204988 - simon - 2011-11-22 14:46:51]
at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:127) ~[hibernate-search-engine-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:102) ~[hibernate-search-engine-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:119) ~[hibernate-search-engine-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.applyUpdates(LuceneBackendQueueTask.java:99) ~[hibernate-search-engine-4.1.1.Final.jar:4.1.1.Final]
at org.hibernate.search.backend.impl.lucene.LuceneBackendQueueTask.run(LuceneBackendQueueTask.java:67) ~[hibernate-search-engine-4.1.1.Final.jar:4.1.1.Final]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) ~[na:1.7.0_03]
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334) [na:1.7.0_03]
at java.util.concurrent.FutureTask.run(FutureTask.java:166) [na:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [na:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [na:1.7.0_03]
at java.lang.Thread.run(Thread.java:722) [na:1.7.0_03]
ERROR 11:39:44.296 default o.h.s.b.i.l.LuceneBackendQueueTask - HSEARCH000072: Couldn't open the IndexWriter because of previous error: operation skipped, index ouf of sync!
This exception occurs after a slight delay, but consistently after every change.
The search related properties that are provided to the EntityManager are:
Code:
hibernate.search.default.directory_provider=infinispan
hibernate.search.infinispan.configuration_resourcename=development-hibernatesearch-infinispan.xml
hibernate.search.​default.​exclusive_index_use = false
hibernate.search.lucene_version = LUCENE_35
We have been trying to find people with similar issues, but most seem to be related to heavy load, restarts, or other (in my (humble) opinion) unrelated issues. Does anybody know what we are doing wrong, or how we could solve this issue?
We are using:
- Hibernate 4.1.3.Final
- Hibernate Search 4.1.1.Final
Thanks a lot!,
with kind regards,
Hidde.