Skip to main content

Software fault tolerance and recovery

Short answer

Fault tolerance enables correct operation despite faults. Roll-back recovery restores a checkpoint and re-executes, losing recent work. Roll-forward recovery moves to a corrected new state without going back, faster but more complex.

What is fault tolerance in software? What do you mean by roll-back recovery and roll-forward recovery?

Fault tolerance in software

Software fault tolerance is the ability of a program to continue operating correctly (or degrade gracefully) even when software faults (bugs) or hardware faults occur. Since software cannot be tested completely, techniques are used: error detection (checks, assertions, watchdogs), error recovery, design diversity (N-version programming, where independent versions vote), recovery blocks (try alternate routines if the acceptance test fails), exception handling and redundancy.

Roll-back recovery

The system periodically saves a consistent state called a checkpoint. When an error is detected, the system goes back to the last checkpoint (restores the saved state) and re-executes from there, hoping that the error was transient.

  • Used in databases (transaction roll-back), operating systems and the recovery-block technique.
  • Simple and general, but needs extra time and memory and loses the work done since the checkpoint; not suitable for real-time actions that cannot be undone.

Roll-forward recovery

When an error occurs, the system does not go back but moves forward to a new, error-free state, by correcting the erroneous state or by skipping to a safe state (for example using the value of redundant modules, or reinitialising and continuing).

  • Used in real-time and critical systems where time does not allow re-execution.
  • Faster, but needs error diagnosis and the knowledge of the correct state, so it is more complex and application-specific.

✓ Answer checked by Claude Sonnet 5.5

All Instrumentation II chapter 9 questions →