Dmitry Sterinzat created IGNITE-12094:
-----------------------------------------

             Summary: Scan Query scheduled to be executed on wrong node
                 Key: IGNITE-12094
                 URL: https://issues.apache.org/jira/browse/IGNITE-12094
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 2.7.5
            Reporter: Dmitry Sterinzat


When Scan query on Replicated cache executes from client node and topology is 
unstable (for example 2 new server nodes are up at the same time) it is 
possible to get empty result:

 

 
{code:java}
// IgniteCacheProxyImpl#projection

// here we return cluster group with random cluster node 
return 
ctx.kernalContext().grid().cluster().forDataNodes(ctx.name()).forRandom();{code}
 
{code:java}
// GridCacheQueryAdapter#executeScanQuery

// Affinity nodes snapshot.
Collection<ClusterNode> nodes = new ArrayList<>(nodes());
...
if (nodes.isEmpty()) {
    if (part != null && forceLocal)
        throw new IgniteCheckedException("No queryable nodes for partition " + 
part
            + " [forced local query=" + this + "]");

    return new GridEmptyCloseableIterator();
} 

// GridCacheQueryAdapter#nodes(final GridCacheContext<?, ?> cctx,
    @Nullable final ClusterGroup prj, @Nullable final Integer part)

    final AffinityTopologyVersion topVer = 
cctx.affinity().affinityTopologyVersion();

// This collection isn't contains randomly selected node because 
AffinityTopologyVersion is previous.
    Collection<ClusterNode> affNodes = CU.affinityNodes(cctx, topVer);
...
    return F.view(affNodes, new P1<ClusterNode>() {
        @Override public boolean apply(ClusterNode n) {
            return cctx.discovery().cacheAffinityNode(n, cctx.name()) &&
                (prj == null || prj.node(n.id()) != null) &&
                (part == null || owners.contains(n));
        }
    });
}


{code}
In our case nodes collection is empty, because node that was randomly selected 
isn't current topology version (cache isn't already started), so we get 
GridEmptyCloseableIterator (query event isn't executed).

 



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to