You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2017/09/12 15:43:00 UTC

[jira] [Commented] (IGNITE-6355) Calculating cache size during cache stop sporadically fails with ClusterGroupEmptyCheckedException

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

ASF GitHub Bot commented on IGNITE-6355:
----------------------------------------

GitHub user glukos opened a pull request:

    https://github.com/apache/ignite/pull/2647

    IGNITE-6355 Calculating cache size during cache stop sporadically fails with ClusterGroupEmptyCheckedException

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/gridgain/apache-ignite ignite-6355

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/ignite/pull/2647.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #2647
    
----
commit 0ca879173e9c7b58f313bddc85b0684faf8b6307
Author: Ivan Rakov <iv...@gmail.com>
Date:   2017-09-12T15:40:15Z

    IGNITE-6355 Calculating cache size during cache stop sporadically fails with ClusterGroupEmptyCheckedException

----


> Calculating cache size during cache stop sporadically fails with ClusterGroupEmptyCheckedException
> --------------------------------------------------------------------------------------------------
>
>                 Key: IGNITE-6355
>                 URL: https://issues.apache.org/jira/browse/IGNITE-6355
>             Project: Ignite
>          Issue Type: Bug
>    Affects Versions: 2.1
>            Reporter: Ivan Rakov
>            Assignee: Ivan Rakov
>              Labels: MakeTeamcityGreenAgain
>             Fix For: 2.3
>
>
> Example stacktrace:
> {noformat}
> [16:21:06,343][ERROR][main][root] Test failed.
> javax.cache.CacheException: class org.apache.ignite.cluster.ClusterGroupEmptyException: Topology projection is empty.
> 	at org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1327)
> 	at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.cacheException(IgniteCacheProxyImpl.java:1672)
> 	at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.size(IgniteCacheProxyImpl.java:762)
> 	at org.apache.ignite.internal.processors.cache.GatewayProtectedCacheProxy.size(GatewayProtectedCacheProxy.java:508)
> 	at org.gridgain.grid.internal.processors.cache.database.IgniteDbSnapshotSelfTest.testReuseCacheProxyAfterRestore(IgniteDbSnapshotSelfTest.java:1793)
> 	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 junit.framework.TestCase.runTest(TestCase.java:176)
> 	at org.apache.ignite.testframework.junits.GridAbstractTest.runTestInternal(GridAbstractTest.java:2000)
> 	at org.apache.ignite.testframework.junits.GridAbstractTest.access$000(GridAbstractTest.java:132)
> 	at org.apache.ignite.testframework.junits.GridAbstractTest$5.run(GridAbstractTest.java:1915)
> 	at java.lang.Thread.run(Thread.java:745)
> Caused by: class org.apache.ignite.cluster.ClusterGroupEmptyException: Topology projection is empty.
> 	at org.apache.ignite.internal.util.IgniteUtils$6.apply(IgniteUtils.java:823)
> 	at org.apache.ignite.internal.util.IgniteUtils$6.apply(IgniteUtils.java:821)
> 	... 14 more
> Caused by: class org.apache.ignite.internal.cluster.ClusterGroupEmptyCheckedException: Topology projection is empty.
> 	at org.apache.ignite.internal.processors.task.GridTaskWorker.getTaskTopology(GridTaskWorker.java:665)
> 	at org.apache.ignite.internal.processors.task.GridTaskWorker.body(GridTaskWorker.java:500)
> 	at org.apache.ignite.internal.util.worker.GridWorker.run(GridWorker.java:110)
> 	at org.apache.ignite.internal.processors.task.GridTaskProcessor.startTask(GridTaskProcessor.java:758)
> 	at org.apache.ignite.internal.processors.task.GridTaskProcessor.execute(GridTaskProcessor.java:454)
> 	at org.apache.ignite.internal.processors.task.GridTaskProcessor.execute(GridTaskProcessor.java:410)
> 	at org.apache.ignite.internal.processors.cache.GridCacheAdapter.sizeAsync(GridCacheAdapter.java:3747)
> 	at org.apache.ignite.internal.processors.cache.GridCacheAdapter.size(GridCacheAdapter.java:3704)
> 	at org.apache.ignite.internal.processors.cache.IgniteCacheProxyImpl.size(IgniteCacheProxyImpl.java:759)
> 	... 11 more
> {noformat}
> Data race stems from here (GridCacheAdapter#sizeAsync):
> {noformat}
>         Group grp = modes.near ? cluster.forCacheNodes(name(), true, true, false) : cluster.forDataNodes(name());
>         Collection<ClusterNode> nodes = grp.nodes();
>         if (nodes.isEmpty())
>             return new GridFinishedFuture<>(0);
>         ctx.kernalContext().task().setThreadContext(TC_SUBGRID, nodes);
>         return ctx.kernalContext().task().execute(
>             new SizeTask(ctx.name(), ctx.affinity().affinityTopologyVersion(), peekModes), null);
> {noformat}
> Method grp.nodes() returns PredicateCollectionView, which size depends on Ignite state. It can pass nodes.isEmpty() check and become empty later.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)