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

Vladimir Steshin updated IGNITE-20507:
--------------------------------------
    Description: 
We keep persistent cache meta on node, which is filtered by the cache node 
filter. If such cache is removed, some nodes can retain 'cache_data.dat'. 

Such nodes can't re-join cluster because they find this 'cache_data.dat' and 
offer the cache when joining the cluster. But the cache has been removed: 
{code:java}
org.apache.ignite.spi.IgniteSpiException: Joining node has caches with data 
which are not presented on cluster, it could mean that they were already 
destroyed, to add the node to cluster - remove directories with the 
caches[TestDynamicCache]
{code}

This happens because we remove persistent cache data in 
`GridCacheProcessor#prepareCacheStop` looking at `Map<String, 
GridCacheAdapter<?, ?>> GridCacheProcessor#caches`. But there is no 
GridCacheAdapter for the cache if the node filter excludes this cache for 
thecurrent node. But 'cache_data.dat' exists. 

The work-around is to acquire a cache proxy on the node for which this cache is 
excluded:
{code:java}
// This fixes the issue!
// cache = grid(2).cache(cfg.getName());
{code}
This creates the proxy and registers missing GridCacheAdapter.


  was:
We keep persistent cache meta on node, which is filtered by the cache node 
filter. If such cache is removed, some nodes can retain 'cache_data.dat'. 

Such nodes can't re-join cluster because they find this 'cache_data.dat' and 
offer this cache when joining the cluster. But the cache has been removed: 
{code:java}
org.apache.ignite.spi.IgniteSpiException: Joining node has caches with data 
which are not presented on cluster, it could mean that they were already 
destroyed, to add the node to cluster - remove directories with the 
caches[TestDynamicCache]
{code}

This happens because we remove persistent cache data in 
`GridCacheProcessor#prepareCacheStop` looking at `Map<String, 
GridCacheAdapter<?, ?>> GridCacheProcessor#caches`. But there is no 
GridCacheAdapter for the cache if the node filter excludes this cache for 
thecurrent node. But 'cache_data.dat' exists. 

The work-around is to acquire a cache proxy on the node for which this cache is 
excluded:
{code:java}
// This fixes the issue!
// cache = grid(2).cache(cfg.getName());
{code}
This creates the proxy and registers missing GridCacheAdapter.



> Persistent cache meta is not removed if node filter skips node.
> ---------------------------------------------------------------
>
>                 Key: IGNITE-20507
>                 URL: https://issues.apache.org/jira/browse/IGNITE-20507
>             Project: Ignite
>          Issue Type: Bug
>            Reporter: Vladimir Steshin
>            Priority: Major
>
> We keep persistent cache meta on node, which is filtered by the cache node 
> filter. If such cache is removed, some nodes can retain 'cache_data.dat'. 
> Such nodes can't re-join cluster because they find this 'cache_data.dat' and 
> offer the cache when joining the cluster. But the cache has been removed: 
> {code:java}
> org.apache.ignite.spi.IgniteSpiException: Joining node has caches with data 
> which are not presented on cluster, it could mean that they were already 
> destroyed, to add the node to cluster - remove directories with the 
> caches[TestDynamicCache]
> {code}
> This happens because we remove persistent cache data in 
> `GridCacheProcessor#prepareCacheStop` looking at `Map<String, 
> GridCacheAdapter<?, ?>> GridCacheProcessor#caches`. But there is no 
> GridCacheAdapter for the cache if the node filter excludes this cache for 
> thecurrent node. But 'cache_data.dat' exists. 
> The work-around is to acquire a cache proxy on the node for which this cache 
> is excluded:
> {code:java}
> // This fixes the issue!
> // cache = grid(2).cache(cfg.getName());
> {code}
> This creates the proxy and registers missing GridCacheAdapter.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to