Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-12094

Scan Query scheduled to be executed on wrong node

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.7.5
    • None
    • cache
    • None
    • Docs Required

    Description

      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:

      // IgniteCacheProxyImpl#projection
      
      // here we return cluster group with random cluster node 
      return ctx.kernalContext().grid().cluster().forDataNodes(ctx.name()).forRandom();

       

      // 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));
              }
          });
      }
      
      
      

      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).

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            dsterinzat Dmitry Sterinzat
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: