Hello,
I meet the same problem using only Hibernate Search. On high concurrency hibernate insert actions, sgbd work is OK but some lucene works are lost. I isolate the issue to WeakIdentityHashMap use in FullTextIndexEventListener before finding this post.
Here is the log stack per threads (builded with some aspect on HS classes) :
- thread "taskExecutor-6" behaviour is correct, on flush FullTextIndexEventListener find PostTransactionWorkQueueSynchronization mapped to current session and ask for it's completion - thread "taskExecutor-3" behaviour is not correct, PostTransactionWorkQueueSynchronization is not finded for current transaction... lucene work is lost
15:05:18,621 (taskExecutor-6) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.AdresseNaissance-8870004 15:05:18,636 (taskExecutor-6) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.Individu-8897003 15:05:18,709 (taskExecutor-6) FullTextIndexEventListener.addSynchronization 15:05:18,711 (taskExecutor-6) PostTransactionWorkQueueSynchronization.add class fr.dsirc.poc.poc_hs_rni.model.Individu-8897003-ADD 15:05:18,792 (taskExecutor-6) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.NumeroInscriptionRepertoire-6276003 15:05:18,798 (taskExecutor-6) PostTransactionWorkQueueSynchronization.add class fr.dsirc.poc.poc_hs_rni.model.NumeroInscriptionRepertoire-6276003-ADD 15:05:18,814 (taskExecutor-6) PostTransactionWorkQueueSynchronization.add class fr.dsirc.poc.poc_hs_rni.model.Individu-8897003-COLLECTION 15:05:18,818 (taskExecutor-6) FullTextIndexEventListener.onFlush 15:05:18,824 TRACE [org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization] (taskExecutor-6) Processing Transaction's beforeCompletion() phase: org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization@1039e58 15:05:18,911 TRACE [org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization] (taskExecutor-6) Processing Transaction's afterCompletion() phase for org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization@1039e58. Performing work. 15:05:18,911 TRACE [org.hibernate.search.backend.impl.BatchedQueueingProcessor] (taskExecutor-6) Lucene WorkQueue to send to backends:[ AddLuceneWork: fr.dsirc.poc.poc_hs_rni.model.Individu#8897003 ]
15:05:18,579 (taskExecutor-3) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.AdresseNaissance-8870005 15:05:18,612 (taskExecutor-3) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.Individu-8897004 15:05:18,708 (taskExecutor-3) FullTextIndexEventListener.addSynchronization ===> synchronisation is added 15:05:18,711 (taskExecutor-3) PostTransactionWorkQueueSynchronization.add class fr.dsirc.poc.poc_hs_rni.model.Individu-8897004-ADD 15:05:18,813 (taskExecutor-3) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.NumeroInscriptionRepertoire-6276002 15:05:18,815 (taskExecutor-3) PostTransactionWorkQueueSynchronization.add class fr.dsirc.poc.poc_hs_rni.model.NumeroInscriptionRepertoire-6276002-ADD 15:05:18,829 (taskExecutor-3) PostTransactionWorkQueueSynchronization.add class fr.dsirc.poc.poc_hs_rni.model.Individu-8897004-COLLECTION 15:05:18,830 (taskExecutor-3) FullTextIndexEventListener.onFlush ===> synchronisation not found for session. Now thread deal with another entity in an other session 15:05:18,882 (taskExecutor-3) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.AdresseNaissance-8870006 15:05:18,887 (taskExecutor-3) FullTextIndexEventListener.onPostInsert class fr.dsirc.poc.poc_hs_rni.model.Individu-8897006
Is there a ticket oppened for this bug ? A workaround ?
|