mike hunts wrote:
I'm using
hibernate.search 5.1.1
hibernate.search.infinispan 5.1.1
jgroups 3.6.3
Spring 3.2.8
In Sync mode <property name="hibernate.search.default.worker.execution" value="sync"/> I'm getting updates to the index.
In Async mode <property name="hibernate.search.default.worker.execution" value="async"/> I'm getting no updates to the index. I determined this by updating then searching.
During and after the transaction that's updating the entity I added:
FullTextEntityManager fullTextEntityManager = Search.getFullTextEntityManager(entityManager);
fullTextEntityManager.flushToIndexes();
Still no index changes.
I don't want to use sync because it's taking 3+ seconds to save and index update.
I've turned up all the logging to TRACE and see no errors.
I've tested while clustered and single node.
Any suggestions on how to troubleshoot or what might be wrong?
You can see below in the config I'm using a custom "hibernate.search.default.worker.backend" = com.company.platform.search.CSJGroupsBackendQueueProcessor
That is just for logging. It extends JGroupsBackendQueueProcessor and calls all it's methods.
Even Weirder, some indexes seem to be updating.
I put a break point in org.hibernate.search.backend.impl.lucene.ScheduleCommitPolicy and it's continually looping between two of my indexes... If i make an update to one of those two it works, but any other it does not.
persistence.xml
<!-- Hibernate Search Settings -->
<property name="hibernate.search.autoregister_listeners" value="true"/>
<property name="hibernate.search.default.worker.thread_pool.size" value="5"/>
<property name="hibernate.search.default.worker.execution" value="async"/>
<property name="hibernate.search.default.indexwriter.max_buffered_docs" value ="1"/>
<!--<property name="hibernate.search.default.indexwriter.infostream" value="true"/>-->
<property name="hibernate.search.lucene_version" value="LUCENE_4_10_4"/>
<property name="hibernate.search.default.directory_provider" value="infinispan"/>
<!--<property name="hibernate.search.default.directory_provider" value="ram"/>-->
<property name="hibernate.search.infinispan.configuration_resourcename"
value="hibernate-search-infinispan.xml"/>
<property name="hibernate.search.default.exclusive_index_use" value="true"/>
<property name="hibernate.search.default.index_flush_interval" value="2000"/>
<!--<property name="hibernate.search.default.worker.backend" value="jgroups"/>-->
<property name="org.hibernate.search.backend.jgroups.impl.AutoNodeSelector"
value="com.company.platform.search.CSNodeSelector"/>
<property name="hibernate.search.default.worker.backend"
value="com.company.platform.search.CSJGroupsBackendQueueProcessor"/>
<property name="hibernate.search.services.jgroups.configurationFile" value="jdbc_ping.xml"/>
hibernate-search-infinispan.xml
<infinispan
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:infinispan:config:7.1 http://www.infinispan.org/schemas/infinispan-config-7.1.xsd
urn:infinispan:config:store:jdbc:7.1 http://www.infinispan.org/schemas/infinispan-cachestore-jdbc-config-7.1.xsd"
xmlns="urn:infinispan:config:7.1"
xmlns:jdbc="urn:infinispan:config:store:jdbc:7.1"
>
<!-- *************************** -->
<!-- System-wide global settings -->
<!-- *************************** -->
<jgroups>
<!-- Note that the JGroups transport uses sensible defaults if no configuration
property is defined. See the JGroupsTransport javadocs for more flags.
jgroups-udp.xml is the default stack bundled in the Infinispan core jar: integration
and tuning are tested by Infinispan. -->
<stack-file name="HibernateSearch-Infinispan-cluster" path="jdbc_ping.xml"/>
</jgroups>
<cache-container name="HibernateSearch" default-cache="default" statistics="false" shutdown-hook="DONT_REGISTER">
<transport stack="HibernateSearch-Infinispan-cluster"/>
<!-- Duplicate domains are allowed so that multiple deployments with default configuration
of Hibernate Search applications work - if possible it would be better to use JNDI to share
the CacheManager across applications -->
<jmx duplicate-domains="true"/>
<!-- *************************************** -->
<!-- Cache to store Lucene's file metadata -->
<!-- *************************************** -->
<replicated-cache name="LuceneIndexesMetadata" mode="SYNC" remote-timeout="480000">
<transaction mode="NONE"/>
<state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>
<indexing index="NONE"/>
<locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>
<eviction max-entries="-1" strategy="NONE"/>
<expiration max-idle="-1"/>
</replicated-cache>
<!-- **************************** -->
<!-- Cache to store Lucene data -->
<!-- **************************** -->
<replicated-cache name="LuceneIndexesData" mode="SYNC" remote-timeout="480000">
<transaction mode="NONE"/>
<state-transfer enabled="true" timeout="480000" await-initial-transfer="true"/>
<indexing index="NONE"/>
<locking striping="false" acquire-timeout="10000" concurrency-level="500" write-skew="false"/>
<eviction max-entries="-1" strategy="NONE"/>
<expiration max-idle="-1"/>
</replicated-cache>
</cache-container>
</infinispan>
<config xmlns="urn:org:jgroups"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:org:jgroups http://www.jgroups.org/schema/JGroups-3.6.xsd">
<TCP_NIO
bind_addr="${jgroups.tcp.address:SITE_LOCAL}"
bind_port="${jgroups.tcp.port:7800}"
port_range="50"/>
<com.company.platform.cluster.AWS_PING
port_number="${jgroups.tcp.port:7800}"
filters="instance-state-name=running"
tags="elasticbeanstalk:environment-id"/>
<MERGE3 max_interval="30000"
min_interval="10000"/>
<FD_SOCK/>
<FD_ALL2/>
<VERIFY_SUSPECT timeout="3000" num_msgs="3"/>
<!-- Max 3 sec to respond for failure suspect. Max 3 trials -->
<pbcast.NAKACK use_mcast_xmit="false"/>
<UNICAST3/>
<RSVP/>
<pbcast.FLUSH/>
<pbcast.STABLE/>
<pbcast.GMS />
<MFC max_credits="2000000" min_threshold="0.10"/>
<FRAG2 frag_size="60000"/>
<CENTRAL_LOCK/>
<pbcast.STATE_TRANSFER/>
</config>
Hibernate Search won’t create a new index in existing directories.
The fundamental Lucene index files are created at framework startup, but existing directories are not modified. Delete the directory: the framework will create it and build the basic index structure at startup. Since 3.1 it detects indexes in existing directories automatically.