setNodeFilter throwing a CacheException

classic Classic list List threaded Threaded
4 messages Options
Shravya Nethula Shravya Nethula
Reply | Threaded
Open this post in threaded view
|

setNodeFilter throwing a CacheException

Hi,

We are trying to create tables on one particular ClusterGroup with 3 server
nodes: Node1, Node2, Node3. On all these 3 nodes we have set the following
configuration in default-config.xml.

<property name="userAttributes">
        <map>
                <entry key="ROLE" value="data.compute"/>
        </map>
</property>

On the client side code, we are trying to setNodeFilter for the
cacheConfiguration as follows:

CacheConfiguration<?, ?> cacheCfg = new
CacheConfiguration<>(this.tableName).setSqlSchema("PUBLIC");
cacheCfg.setNodeFilter(new DataNodeFilter());
IgniteCache<?, ?> cache = ignite.getOrCreateCache(cacheCfg);  
//IgniteTable.java:50

The DataNodeFilter has the following code:

public class DataNodeFilter implements IgnitePredicate<ClusterNode> {
  @Override public boolean apply(ClusterNode node) {
    // The service will be deployed on non client nodes
    // that have the attribute 'data.compute'.
    return !node.isClient() &&
        node.attributes().containsValue("data.compute");
  }
}

Inspite of all these configuration setting, it still throws a
CacheExaception as follows:
Exception in thread "main" javax.cache.CacheException: class
org.apache.ignite.IgniteClientDisconnectedException: Failed to execute
dynamic cache change request, client node disconnected.
        at
org.apache.ignite.internal.processors.cache.GridCacheUtils.convertToCacheException(GridCacheUtils.java:1287)
        at
org.apache.ignite.internal.IgniteKernal.getOrCreateCache0(IgniteKernal.java:2937)
        at
org.apache.ignite.internal.IgniteKernal.getOrCreateCache(IgniteKernal.java:2906)
        at
net.aline.cloudedh.inmemorydb.ignite.IgniteTable.<init>(IgniteTable.java:50)

Can anyone please tell if we are missing any other configuration setting?

Regards,
Shravya Nethula.



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
dkarachentsev dkarachentsev
Reply | Threaded
Open this post in threaded view
|

Re: setNodeFilter throwing a CacheException

Hi Sharavya,

This exception means that client node is disconnected from cluster and tries
to reconnect. You may get reconnect future on it
(IgniteClientDisconnectedException.reconnectFuture().get()) and wait when
client will be reconnected.

So it looks like you're trying to create cache on stopped cluster and it has
nothing with node filter. Can you share logs from all nodes?

Thanks!
-Dmitry



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
Shravya Nethula Shravya Nethula
Reply | Threaded
Open this post in threaded view
|

Re: setNodeFilter throwing a CacheException

Hi Dmitry,

Please find the logs below:

2018-01-26 07:52:28,563][INFO ][exchange-worker-#42][time] Started exchange
init [topVer=AffinityTopologyVersion [topVer=29, minorTopVer=0], crd=true,
evt=NODE_JOINED, evtNode=649c5360-7060-40cf-9454-ad6d08be2a7c,
customEvt=null, allowMerge=true]
[2018-01-26 07:52:28,563][INFO
][exchange-worker-#42][GridDhtPartitionsExchangeFuture] Finish exchange
future [startVer=AffinityTopologyVersion [topVer=29, minorTopVer=0],
resVer=AffinityTopologyVersion [topVer=29, minorTopVer=0], err=null]
[2018-01-26 07:52:28,564][INFO ][exchange-worker-#42][time] Finished
exchange init [topVer=AffinityTopologyVersion [topVer=29, minorTopVer=0],
crd=true]
[2018-01-26 07:52:28,564][INFO
][exchange-worker-#42][GridCachePartitionExchangeManager] Skipping
rebalancing (nothing scheduled) [top=AffinityTopologyVersion [topVer=29,
minorTopVer=0], evt=NODE_JOINED, node=649c5360-7060-40cf-9454-ad6d08be2a7c]
[2018-01-26 07:52:29,963][INFO
][grid-nio-worker-tcp-comm-0-#25][TcpCommunicationSpi] Accepted incoming
communication connection [locAddr=/10.0.0.3:47100,
rmtAddr=/183.82.140.186:31996]
[2018-01-26 07:52:41,461][ERROR][tcp-disco-msg-worker-#3][TcpDiscoverySpi]
Failed to unmarshal discovery custom message.
class org.apache.ignite.IgniteCheckedException: Failed to find class with
given class loader for unmarshalling (make sure same versions of all classes
are available on all nodes or enable peer-class-loading)
[clsLdr=sun.misc.Launcher$AppClassLoader@764c12b6,
cls=net.aline.cloudedh.inmemorydb.ignite.DataNodeFilter]
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:126)
        at
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:94)
        at
org.apache.ignite.marshaller.jdk.JdkMarshaller.unmarshal0(JdkMarshaller.java:143)
        at
org.apache.ignite.marshaller.AbstractNodeNameAwareMarshaller.unmarshal(AbstractNodeNameAwareMarshaller.java:82)
        at
org.apache.ignite.internal.util.IgniteUtils.unmarshal(IgniteUtils.java:9795)
        at
org.apache.ignite.spi.discovery.tcp.messages.TcpDiscoveryCustomEventMessage.message(TcpDiscoveryCustomEventMessage.java:81)
       
Please let us know if we are missing any configurations!

Regards,
Shravya Nethula.




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
dkarachentsev dkarachentsev
Reply | Threaded
Open this post in threaded view
|

Re: setNodeFilter throwing a CacheException

Hi Shravya,

To understand what's going on in your cluster I need full logs from all
nodes. Please, share all files, if it's possible.

Thanks!
-Dmitry



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/