1 Reply Latest reply on Aug 31, 2010 3:16 PM by an1310

    Infinispan-Query can't work in Infinispan Distribution Mode

    liliyancn

      I use Infinispan 4.1.0.CR3 and Hibernate-Search 3.1.1.GA, I use Infinispan-lucene-directory to store index. When I use "LOCAL", "replication", "invalidation" mode, infinispan-query works normally, but when I switch to "distribution" mode infinispan-query doesn't index the cache region, and the "getDirectory()" function of "DirectoryProvider" just be called when initialize the directory provider.

       

      First, I want to confirm if Infinispan-Query supports Distribution Mode. I open the ClusteredCacheTest.java of the unit test of infinispan-query 4.1.0.CR3. I change the "createCacheManagers()" function to use the Distribution Mode, that means :

       

      change this line

          "Configuration cacheCfg = getDefaultClusteredConfig(REPL_SYNC);"
      to

          "Configuration cacheCfg = getDefaultClusteredConfig(DIST_SYNC);"

       

      also change the import, from

          "import static org.infinispan.config.Configuration.CacheMode.REPL_SYNC;"

      to

          "import static org.infinispan.config.Configuration.CacheMode.DIST_SYNC;"

       

      And, when I run the unit test, it fails :

       

      Failed tests:
        testAdded(org.infinispan.query.blackbox.ClusteredCacheTest)
        testClear(org.infinispan.query.blackbox.ClusteredCacheTest)
        testGetResultSize(org.infinispan.query.blackbox.ClusteredCacheTest)
        testModified(org.infinispan.query.blackbox.ClusteredCacheTest)
        testRemoved(org.infinispan.query.blackbox.ClusteredCacheTest)
        testSimple(org.infinispan.query.blackbox.ClusteredCacheTest)
        testAdded(org.infinispan.query.blackbox.MarshalledValueClusteredQueryTest)
        testClear(org.infinispan.query.blackbox.MarshalledValueClusteredQueryTest)
        testGetResultSize(org.infinispan.query.blackbox.MarshalledValueClusteredQueryTest)
        testModified(org.infinispan.query.blackbox.MarshalledValueClusteredQueryTest)
        testRemoved(org.infinispan.query.blackbox.MarshalledValueClusteredQueryTest)
        testSimple(org.infinispan.query.blackbox.MarshalledValueClusteredQueryTest)

       

      Tests run: 81, Failures: 12, Errors: 0, Skipped: 0

       

      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] There are test failures.

       

      I open "TEST-org.infinispan.query.blackbox.ClusteredCacheTest-testGetResultSize.xml", it says :

       

      <?xml version="1.0" encoding="UTF-8" ?>
      <testsuite time="0" name="org.infinispan.query.blackbox.ClusteredCacheTest-testGetResultSize">
        <testcase time="0.406" classname="org.infinispan.query.blackbox.ClusteredCacheTest" name="org.infinispan.query.blackbox.ClusteredCacheTest-testGetResultSize">
          <failure type="java.lang.AssertionError">java.lang.AssertionError
              at org.infinispan.query.blackbox.ClusteredCacheTest.testGetResultSize(ClusteredCacheTest.java:229)
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:644)
              at org.testng.internal.Invoker.invokeMethod(Invoker.java:546)
              at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:700)
              at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1002)
              at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:137)
              at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:121)
              at org.testng.TestRunner.runWorkers(TestRunner.java:909)
              at org.testng.TestRunner.privateRun(TestRunner.java:618)
              at org.testng.TestRunner.run(TestRunner.java:499)
              at org.testng.SuiteRunner.runTest(SuiteRunner.java:332)
              at org.testng.SuiteRunner.access$000(SuiteRunner.java:33)
              at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:358)
              at org.testng.internal.thread.ThreadUtil$CountDownLatchedRunnable.run(ThreadUtil.java:142)
              at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
              at java.lang.Thread.run(Thread.java:619)
      </failure>
        </testcase>
      </testsuite>

       

      So, that means the Infinispan-Query doesn't support Distribution Mode by now. If I'm correct?

       

      Second, if it did, how can I set up infinispan-lucence-directory to put index into a cluster? That means if the cache region I need to index is Distribution Mode, the "indexLocalOnly" is true or false? And if I set up a cache region, for example name "indexRegion", to store index, if I can set up this region as Distribution Mode? and how can infinispan-query handle multithread IndexWriter problem from a cluster perspective?

       

      If any body can help me, thanks.

        • 1. Re: Infinispan-Query can't work in Infinispan Distribution Mode
          an1310

          Hi Richard,

           

          You may want to check a few things first.  According to the Query Wiki Page, for DIST mode you need to use a shared index store and set indexLocalOnly to true. 

           

          The referenced unit test uses a RAM Directory index store (not shared) and the default configuration (inherited from AbstractCacheTest) would have the "indexLocalOnly" value as false.  I would check these issues and comment if the unit test passes.