You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Sergey Kadaner (Jira)" <ji...@apache.org> on 2022/05/17 15:25:00 UTC

[jira] [Commented] (IGNITE-9878) Failed to start near cache after second call of getOrCreateCache

    [ https://issues.apache.org/jira/browse/IGNITE-9878?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538282#comment-17538282 ] 

Sergey Kadaner commented on IGNITE-9878:
----------------------------------------

I am getting the same error while retrieving a cache by name from the SpringCacheManager:
{noformat}
javax.cache.CacheException: class org.apache.ignite.IgniteCheckedException: Failed to start near cache (local node is an affinity node for cache): myCacheName
    at org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1270) ~[ignite-core-2.9.1.jar:2.9.1]
    at org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:3376) ~[ignite-core-2.9.1.jar:2.9.1]
    at org.apache.ignite.cache.spring.SpringCacheManager.getCache(SpringCacheManager.java:356) ~[ignite-spring-2.9.1.jar:2.9.1]{noformat}

> 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
>         Attachments: NearCacheIssueReproducer.java, NearCacheTest.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: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
(v8.20.7#820007)