GridGain Developers Hub
GitHub logo GridGain iso GridGain.com
GridGain Software Documentation

Fault Tolerance

GridGain 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 will ever be 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 will not be failed over.

    <bean class="org.apache.ignite.IgniteConfiguration">
      ...
      <property name="failoverSpi">
        <bean class="org.apache.ignite.spi.failover.always.AlwaysFailoverSpi">
          <property name="maximumFailoverAttempts" value="5"/>
        </bean>
      </property>
      ...
    </bean>
    AlwaysFailoverSpi failSpi = new AlwaysFailoverSpi();
    
    IgniteConfiguration cfg = new IgniteConfiguration();
    
    // Override maximum failover attempts.
    failSpi.setMaximumFailoverAttempts(5);
    
    // Override the default failover SPI.
    cfg.setFailoverSpi(failSpi);
    
    // Start a node.
    Ignition.start(cfg);
    Unsupported
  • NeverFailoverSpi — This implementation never fails over failed jobs.

    <bean class="org.apache.ignite.IgniteConfiguration" >
      ...
      <property name="failoverSpi">
        <bean class="org.apache.ignite.spi.failover.never.NeverFailoverSpi">
        </bean>
      </property>
      ...
    </bean>
    NeverFailoverSpi failSpi = new NeverFailoverSpi();
    
    IgniteConfiguration cfg = new IgniteConfiguration();
    
    // Override the default failover SPI.
    cfg.setFailoverSpi(failSpi);
    
    // Start a node.
    Ignition.start(cfg);
    Unsupported
  • JobStealingFailoverSpi — This implementation must be used only if you want to enable job stealing.