[ 
https://issues.apache.org/jira/browse/IGNITE-9878?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Roman Guseinov updated IGNITE-9878:
-----------------------------------
    Attachment:     (was: NearCacheIssueReproducer.java)

> 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
>            Priority: Major
>
> 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:1305)
>       at 
> org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2995)
>       at 
> org.apache.ignite.reproducers.cache.NearCacheIssueReproducer.testRepeatedGetOrCreateCache(NearCacheIssueReproducer.java:24)
> 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:5235)
>       at 
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.dynamicStartCache(GridCacheProcessor.java:3621)
>       at 
> org.apache.ignite.internal.processors.cache.GridCacheProcessor.dynamicStartCache(GridCacheProcessor.java:3560)
>       at 
> org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2983)
>       ... 23 more
> {code}
> Also, if a cache is specified in the IgniteConfiguration, 
> `Ignite#getOrCreateNearCache` will fail with the following exception:
> {code:java}
> javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: 
> Failed to start near cache (a cache with the same name without near cache is 
> already started)
>       at 
> org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1305)
>       at 
> org.apache.ignite.internal.IgniteKernal.getOrCreateNearCache(IgniteKernal.java:3072)
>       at 
> org.apache.ignite.reproducers.cache.NearCacheIssueReproducer.testGetOrCreateNearCache(NearCacheIssueReproducer.java:32)
> Caused by: class org.apache.ignite.IgniteCheckedException: Failed to start 
> near cache (a cache with the same name without near cache is already started)
>       at 
> org.apache.ignite.internal.IgniteKernal.checkNearCacheStarted(IgniteKernal.java:3085)
>       at 
> org.apache.ignite.internal.IgniteKernal.getOrCreateNearCache(IgniteKernal.java:3067)
>       ... 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