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

Ilya Lantukh commented on IGNITE-7766:
--------------------------------------

This fix doesn't look correct to me. I've debugged this test and can explain 
how this exception happens.

Take a look at GridReduceQueryExecutor.stableDataNodes(...) method. Assume that 
cacheIds.get(0) is ID of replicated cache, and cacheIds.get(1) is partitioned. 
Also, there is one node that has some partitions, but isn't primary for any of 
them.

{noformat}
if (extraCctx.isReplicated()) {
    if (isReplicatedOnly) {
        nodes.retainAll(extraNodes);

        disjoint = map.isEmpty();
    }
    else
        disjoint = !extraNodes.containsAll(nodes);
}
else
    disjoint = !extraNodes.equals(nodes);

if (disjoint) {
    if (isPreloadingActive(cacheIds))
        return null; // Retry.
    else
        throw new CacheException("Caches have distinct sets of data nodes 
[cache1=" + cctx.name() +
            ", cache2=" + extraCacheName + "]");
}
{noformat}

Since extraCctx.isReplicated() == false, we check that node sets for both 
caches are equal. These sets are calculated in the 
GridReduceQueryExecutor.stableDataNodesMap(...) method. For replicated caches, 
it will return all data nodes, but for partitioned ones it will return only 
those nodes that are primary for at least one partition. So, *extraNodes* will 
contain that one node that isn't primary, but *nodes* will not, and so disjoint 
== true.

One way to fix it is to ensure that the first cache in the cacheIds collection 
is always partitioned. Another is to add *else if (cctx.isReplicated())* check. 
I'm not sure that such changes won't break any other query-related 
functionality though.

> Ignite Queries 2: Test always failed 
> IgniteCacheQueryNodeRestartTxSelfTest.testRestarts
> ---------------------------------------------------------------------------------------
>
>                 Key: IGNITE-7766
>                 URL: https://issues.apache.org/jira/browse/IGNITE-7766
>             Project: Ignite
>          Issue Type: Task
>          Components: sql
>            Reporter: Dmitriy Pavlov
>            Assignee: Evgenii Zagumennov
>            Priority: Major
>              Labels: MakeTeamcityGreenAgain
>
> Ignite Queries 2 
>  IgniteBinaryCacheQueryTestSuite2: 
> IgniteCacheQueryNodeRestartTxSelfTest.testRestarts (fail rate 76,1%)
> IgniteCacheQueryNodeRestartTxSelfTest.testRestarts 
>  Current failure: refs/heads/master #345 No changes 11 Feb 18 03:03
> junit.framework.AssertionFailedError: On large page size must retry.
> Last runs fails with 100% probability.



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

Reply via email to