ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alper Tekinalp <al...@evam.com>
Subject Re: NullPointerException on ScanQuery
Date Wed, 21 Dec 2016 06:53:29 GMT
Hi Val.

Do you have an idea what is causing the NPE in the first place?


As Andrey says the exception is caused because of different topology
versions cluster nodes.


> What is null?
>

Node is null in the following code in
org.apache.ignite.internal.processors.cache.query.ScanQueryFallbackClosableIterator.init():


710:            final ClusterNode node = nodes.poll();
711:
712:            if (*node*.isLocal()) {

and nodes found as:

        private Queue<ClusterNode> fallbacks(AffinityTopologyVersion
topVer) {
            Deque<ClusterNode> fallbacks = new LinkedList<>();
            Collection<ClusterNode> owners = new HashSet<>();

            for (ClusterNode node : cctx.topology().owners(part, topVer)) {
                if (node.isLocal())
                    fallbacks.addFirst(node);
                else
                    fallbacks.add(node);

                owners.add(node);
            }

            for (ClusterNode node : cctx.topology().moving(part)) {
                if (!owners.contains(node))
                    fallbacks.add(node);
            }

            return fallbacks;
        }

It is clear that if topology versions are different NPE is expected.

But my claim is NPE can occur without any change in topology versions. In
the example/dummy code NPE happens before any change in topology versions
on cluster. But I could not convince him about that :) Or I am missing
somthing really badly.

Thanks all of you.

Regards.

-- 
Alper Tekinalp

Software Developer
Evam Streaming Analytics

Atatürk Mah. Turgut Özal Bulv.
Gardenya 5 Plaza K:6 Ataşehir
34758 İSTANBUL

Tel:  +90 216 455 01 53 Fax: +90 216 455 01 54
www.evam.com.tr
<http://www.evam.com>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message