Search code examples
javaignite

Ignite Compute : Is it possible to continue jobs execution while the client is gone ? (crashed for exemple)


I have an ignite compute grid composed of 8 server nodes and 1 client. The client sends tasks to the servers:

ignite.compute().withExecutor("myPool").withNoResultCache().call(calls);

The servers then performs the corresonding tasks, then write the results of the tasks in a cloud storage (which is not part of the cluster). Servers are configured to use jobstealingSPI and K8 TCPdiscoverySPI.

    TcpDiscoverySpi tcpDS = new TcpDiscoverySpi();
    TcpDiscoveryKubernetesIpFinder ipFinder = new TcpDiscoveryKubernetesIpFinder();
    ipFinder.setNamespace("ignite");
    tcpDS = tcpDS.setIpFinder(ipFinder);
    cfg.setDiscoverySpi(tcpDS);

    JobStealingCollisionSpi spi = new JobStealingCollisionSpi();
    spi.setWaitJobsThreshold(1);
    spi.setMessageExpireTime(1000);
    spi.setMaximumStealingAttempts(10);
    spi.setActiveJobsThreshold(1);
    spi.setStealingEnabled(true);

    JobStealingFailoverSpi failoverSpi = new JobStealingFailoverSpi();

However, when the client disconnects or crashes, the server nodes stop executing the tasks that were sent.

As the client is not necessarly needed in the cluster from the moment the tasks are sent, is there a way to force the servers to continue the jobs that were sent ?

Also, is there a duplicate a client node in the cluster without duplicating the computetask order ? (client node redundancy)


Solution

  • You can use ComputeTaskMapAsync annotation, it will use another node to map the query, instead of a local one. TO use this annotation you will need to use ComputeTask instead of IgniteCallable.