Uploaded image for project: 'Hibernate Search'
  1. HSEARCH-2426

Remote analyzer initialization fails when using dynamic sharding on Elasticsearch

    Details

      Description

      Currently the automated tests pass, but only because other tests were executed in the same JVM just a moment before, which initialized the (*mutable!*) static variables org.hibernate.search.analyzer.impl.RemoteAnalyzerReference.DEFAULT and org.hibernate.search.analyzer.impl.RemoteAnalyzerReference.PASS_THROUGH.

      In the common case, index managers have been created when org.hibernate.search.engine.impl.ConfigContext.initLazyAnalyzerReferences(IndexManagerHolder) is called in org.hibernate.search.spi.SearchIntegratorBuilder.initDocumentBuilders(SearchConfiguration, BuildContext, SearchMapping), allowing the analyzers to be initialized: we use the index managers to determine which type of analyzers is used (remote or Lucene).

      In the dynamic sharding case, the index managers are not created yet when initializing the analyzers and thus the analyzers are not initialized, which results in a dangling remote analyzer reference, which ultimately explodes.
      Index managers are not yet created because they are created lazily when using dynamic sharding, as shown in IndexManagerHolder line 97.

      The analyzer initialization should not rely on the index managers being created before hand, now that we have the notion of IndexManagerType.

      Relevant tests: everything in package org.hibernate.search.test.shards. Please make sure to enable those tests when solving this ticket.

        Attachments

          Issue links

            Activity

              People

              • Assignee:
                yrodiere Yoann Rodière
                Reporter:
                yrodiere Yoann Rodière
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: