Index clash with multi-tenancy

Description

I've added Hibernate multi-tenancy to my persistence unit and I started noticing weird results from Hibernate Search queries and then I've identified this log:

INFO [org.hibernate.search.backend.impl.lucene.works.IndexUpdateVisitor] (Hibernate Search sync consumer thread for index it.saiv.oss.common.model.entity.Person) HSEARCH000249: Cannot do fast deletes on index 'it.saiv.oss.common.model.entity.Person'. Entities in this index are conflicting or the index can accept unknown entities.

So I set an indexBase on my persistence unit and I noticed indexes are organized by class, so maybe different tenants are clashing on the same indexes for each class.

This is the relevant part of my persistence unit properties:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 <properties> <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.2" /> <property name="wildfly.jpa.hibernate.search.module" value="org.hibernate.search.orm:5.7.0.Final" /> <property name="hibernate.connection.datasource" value="java:/datasources/saiv/default" /> <property name="hibernate.multiTenancy" value="DATABASE" /> <property name="hibernate.multi_tenant_connection_provider" value="org.hibernate.engine.jdbc.connections.spi. DataSourceBasedMultiTenantConnectionProviderImpl" /> <property name="hibernate.tenant_identifier_resolver" value="it.saiv.oss.base.jpa.multitenancy. ScopedTenantIdentifierResolver" /> <property name="hibernate.search.default.indexBase" value="/var/lucene/indexes" /> </properties>

Environment

None

Status

Assignee

Unassigned

Reporter

Giovanni Lovato

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Affects versions

5.7.0.Final

Priority

Major