Roman Guseinov created IGNITE-9878:
--------------------------------------

             Summary: Failed to start near cache after second call of 
getOrCreateCache
                 Key: IGNITE-9878
                 URL: https://issues.apache.org/jira/browse/IGNITE-9878
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 2.6
            Reporter: Roman Guseinov
            Assignee: Roman Guseinov
         Attachments: NearCacheIssueReproducer.java

Repeated call of `Ignite.getOrCreateCache(CacheConfiguration<K, V> cacheCfg, 
NearCacheConfiguration<K, V> nearCfg)` lead the following exception:

{code:java}
javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: 
Failed to start near cache (local node is an affinity node for cache): 
ignite-test-near-rep

        at 
org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1300)
        at 
org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2872)
        at 
org.apache.ignite.examples.NearCacheIssueReproducer.testIgniteNearCacheReplicated(NearCacheIssueReproducer.java:29)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
        at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
        at 
com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
        at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start near 
cache (local node is an affinity node for cache): ignite-test-near-rep
        at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.prepareCacheChangeRequest(GridCacheProcessor.java:4302)
        at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.dynamicStartCache(GridCacheProcessor.java:2877)
        at 
org.apache.ignite.internal.processors.cache.GridCacheProcessor.dynamicStartCache(GridCacheProcessor.java:2816)
        at 
org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2860)
        ... 23 more
{code}

The test is attached  [^NearCacheIssueReproducer.java]. The workaround is to 
put near cache config into cache configuration 
`CacheConfiguration.setNearConfiguration`.




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to