| = Fault Tolerance |
| :javaFile: {javaCodeDir}/FaultTolerance.java |
| |
| Ignite supports automatic job failover. |
| In case of a node crash, jobs are automatically transferred to other available nodes for re-execution. |
| As long as there is at least one node standing, no job is ever lost. |
| |
| The global failover strategy is controlled by the `IgniteConfiguration.failoverSpi` property. |
| |
| Available implementations: |
| |
| * `AlwaysFailoverSpi` — This implementation always reroutes a failed job to another node, and is used by default. |
| + |
| When a job from a compute task fails, an attempt is made to reroute the failed job to a node that has not executed any other job from the same task. If no such node is available, then an attempt is made to reroute the failed job to one of the nodes that may be running other jobs from the same task. If none of the above attempts succeeds, then the job is not failed over. |
| + |
| [tabs] |
| -- |
| tab:XML[] |
| [source,xml] |
| ---- |
| include::code-snippets/xml/failover-always.xml[tags=ignite-config;!discovery, indent=0] |
| ---- |
| tab:Java[] |
| [source,java] |
| ---- |
| include::{javaFile}[tag=always,indent=0] |
| ---- |
| tab:C#/.NET[unsupported] |
| tab:C++[unsupported] |
| -- |
| |
| |
| * `NeverFailoverSpi` — This implementation never fails over failed jobs. |
| + |
| [tabs] |
| -- |
| tab:XML[] |
| [source,xml] |
| ---- |
| include::code-snippets/xml/failover-never.xml[tags=ignite-config;!discovery, indent=0] |
| ---- |
| tab:Java[] |
| [source,java] |
| ---- |
| include::{javaFile}[tag=never,indent=0] |
| ---- |
| tab:C#/.NET[unsupported] |
| tab:C++[unsupported] |
| -- |
| |
| * `JobStealingFailoverSpi` — This implementation must be used only if you want to enable link:distributed-computing/load-balancing#job-stealing[job stealing]. |