These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]

Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: MassIndexer & Infinispan/JGroups cluster
PostPosted: Tue Oct 24, 2017 5:58 am 

Joined: Tue Oct 24, 2017 5:33 am
Posts: 1
Hi there,

i'm trying to get MassIndexer running on a Hibernate Search (v5.6.3.Final) cluster. I'm using JGroups with automatic master election strategy as worker backend (http://docs.jboss.org/hibernate/search/ ... ps-backend -> Automatic master election).

If i try to run a MassIndexer on a slave node, it fails with a LockException (as already mentioned in the Tip at the end of the Automatic Master Election topic: ...Also optimisation and MassIndexer operations need to be triggered on the master node...):

2017-10-23 13:48:26,468 ERROR [org.hibernate.search.backend.impl.lucene.LuceneBackendTaskStreamer] (default task-14) HSEARCH000072: Couldn't open the IndexWriter because of previous error: operation skipped, index ouf of sync!
2017-10-23 13:48:26,483 ERROR [org.hibernate.search.exception.impl.LogErrorHandler] (default task-14) HSEARCH000058: HSEARCH000117: IOException on the IndexWriter: org.apache.lucene.store.LockObtainFailedException: lock instance already assigned
   at org.infinispan.lucene.impl.CommonLockObtainUtils.failLockAcquire(CommonLockObtainUtils.java:33)
   at org.infinispan.lucene.impl.CommonLockObtainUtils.attemptObtain(CommonLockObtainUtils.java:20)
   at org.infinispan.lucene.impl.BaseLockFactory.obtainLock(BaseLockFactory.java:35)
   at org.infinispan.lucene.impl.BaseLockFactory.obtainLock(BaseLockFactory.java:18)
   at org.infinispan.lucene.impl.DirectoryLucene.obtainLock(DirectoryLucene.java:152)
   at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:776)
   at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.createNewIndexWriter(IndexWriterHolder.java:126)
   at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:92)
   at org.hibernate.search.backend.impl.lucene.IndexWriterHolder.getIndexWriter(IndexWriterHolder.java:111)
   at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriter(AbstractWorkspaceImpl.java:113)
   at org.hibernate.search.backend.impl.lucene.AbstractWorkspaceImpl.getIndexWriterDelegate(AbstractWorkspaceImpl.java:214)
   at org.hibernate.search.backend.impl.lucene.LuceneBackendTaskStreamer.doWork(LuceneBackendTaskStreamer.java:44)
   at org.hibernate.search.backend.impl.lucene.WorkspaceHolder.applyStreamWork(WorkspaceHolder.java:74)
   at org.hibernate.search.indexes.spi.DirectoryBasedIndexManager.performStreamOperation(DirectoryBasedIndexManager.java:103)
   at org.hibernate.search.backend.impl.batch.DefaultBatchBackend.flush(DefaultBatchBackend.java:87)
   at org.hibernate.search.batchindexing.impl.BatchCoordinator.afterBatch(BatchCoordinator.java:148)
   at org.hibernate.search.batchindexing.impl.BatchCoordinator.runWithErrorHandler(BatchCoordinator.java:98)
   at org.hibernate.search.batchindexing.impl.ErrorHandledRunnable.run(ErrorHandledRunnable.java:32)
   at org.hibernate.search.batchindexing.impl.MassIndexerImpl.startAndWait(MassIndexerImpl.java:213)


Is there any way, to let the MassIndexer delegate it's indexing work to the current master node?

Any help is much appreciated as this is currently a blocker for my use case.


 Post subject: Re: MassIndexer & Infinispan/JGroups cluster
PostPosted: Wed Oct 25, 2017 2:43 am 
Hibernate Team
Hibernate Team

Joined: Thu Aug 17, 2017 2:51 am
Posts: 3
> Is there any way, to let the MassIndexer delegate it's indexing work to the current master node?

None that I know of. And looking at the MassIndexer code, it very obviously only manipulate local resources, so you're unlikely to find any built-in solution.

I suppose that you could design your own solution, though, by leveraging the existing JGroups cluster, but that would be a lot of work.

What do you need the mass indexer for? If it's only for the initial indexing, you could just start one node (which would be the master), do the mass indexing on this node, and only once mass indexing finished, start the other nodes. That would be by far the easiest solution.

Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.