---
title: "Forward/backward recovery; checkpointing"
subject: "Distributed System"
chapter: 9
key: "semester_7/distributed_system:forward-backward-coordinated-ckpt"
source: https://www.bctengineer.com/q/semester_7/distributed_system/forward-backward-coordinated-ckpt
site: BCT Engineering
---

# Forward/backward recovery; checkpointing

Distributed System · Chapter 9: Fault Tolerance

- Asked in: 2076 Chaitra, 2+6 marks
- Video: [Distributed System -Checkpoint and rollback recovery](https://www.youtube.com/watch?v=HRlsD-djWAM) — Balaji K
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/forward-backward-coordinated-ckpt
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-9

## Question

What do you mean by forward and backward recovery? How to implement coordinated check pointing for recovery in DS?

## Short answer

Backward recovery rolls the system back to a previously saved consistent state (checkpoint), losing recent work; forward recovery corrects errors without going back, using techniques like error-correcting codes. Coordinated checkpointing uses a coordinator to request all processes to take tentative checkpoints, then makes them permanent; after a failure, all roll back to this consistent recovery line.

## Answer

#### Backward recovery
The system is brought back to a **previously saved correct state** (a *recovery point* or checkpoint) and execution resumes from there. The state is recorded periodically by **checkpointing** and/or **message logging**. It is general-purpose and does not need to know which error occurred, but it has overhead (saving state), it loses the work done since the checkpoint, and it is impossible for some operations (e.g. once a cash dispenser has paid out money, that cannot be undone). Example: restoring a database from a checkpoint and replaying the log.

#### Forward recovery
The system moves to a **new correct state** from which it can continue, by correcting the error without going back. It requires knowing in advance which errors may occur. Examples: **error-correcting codes**, and **erasure correction**, where a lost packet is reconstructed from other, successfully delivered packets instead of being resent.

| Point | Backward recovery | Forward recovery |
|---|---|---|
| Idea | Roll back to saved state | Move to new correct state |
| Error knowledge | Not needed | Needed in advance |
| Overhead | Checkpoint cost, lost work | Less, but designed per error |
| Generality | General | Specific |
| Example | Checkpoint/restart | Error-correcting codes |

#### Coordinated checkpointing for recovery
In **coordinated checkpointing**, all processes take their checkpoints together so that the set of checkpoints is a consistent global state.

Blocking two-phase protocol:
1. The coordinator takes a local checkpoint and sends *CHECKPOINT_REQUEST* to all processes.
2. A process receiving the request takes a **tentative** local checkpoint, stops sending application messages, and acknowledges.
3. After receiving all acknowledgements, the coordinator sends *CHECKPOINT_DONE*; each process makes its checkpoint permanent, discards the old one and resumes.

Non-blocking alternative: the **Chandy-Lamport marker** algorithm records the states using markers sent along the channels.

```text
Coordinator   P1   P2   P3
   request --> ... tentative ckpt
   <-- ack ---
   done ----> permanent, resume
```
On a failure, all processes roll back to the last permanent checkpoint. This set is consistent, so there is no domino effect, and only one checkpoint per process needs to be stored; the cost is the coordination messages and the blocking delay.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which is an example of forward recovery?
   A. Checkpoint/restart
   B. Error-correcting codes
   C. Log replay
   D. Rollback to recovery line
   Answer: B. Forward recovery corrects the error and moves to a new correct state. (Key point: Forward recovery example)

2. In blocking coordinated checkpointing, what does a process do on receiving CHECKPOINT_REQUEST?
   A. Takes a permanent checkpoint immediately
   B. Takes a tentative checkpoint, stops sending application messages and acknowledges
   C. Ignores it
   D. Rolls back
   Answer: B. It becomes permanent only after the coordinator sends CHECKPOINT_DONE. (Key point: Tentative checkpoint)

3. Why does coordinated checkpointing avoid the domino effect?
   A. It takes no checkpoints
   B. The checkpoints form a consistent global state, so rollback goes to the last permanent set
   C. It logs all messages
   D. It uses timestamps
   Answer: B. Consistency means no cascading rollbacks; only one checkpoint per process is needed. (Key point: Domino effect)

## Related in Distributed System

- [Short note: Forward and backward recovery](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aforward-backward-note) — Distributed System, chapter 9, asked 2×
- [Independent vs coordinated checkpointing; snapshot](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aindependent-coordinated-snapshot) — Distributed System, chapter 9
- [Avoiding faults; checkpointing compared](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aavoid-faults-checkpointing) — Distributed System, chapter 9
- [Define DS and its requirements](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Adefine-ds-requirements) — Distributed System, chapter 1, asked 3×

## Related in other subjects

- [Forward vs backward chaining](https://www.bctengineer.com/question.md?key=semester_6%2Fartificial_intelligence%3Aforward-vs-backward-chaining) — Artificial Intelligence, chapter 4, asked 3×
- [Infinite line: surge impedance and forward/backward waves](https://www.bctengineer.com/question.md?key=semester_8%2Fhigh_voltage_engineering%3Ainfinite-line-surge-impedance-waves) — High Voltage Engineering, chapter 3
- [Governing equations; forward, backward, central differencing](https://www.bctengineer.com/question.md?key=semester_8%2Fcomputational_techniques_in_civil_engineering%3Agoverning-eq-forward-backward-central) — Computational Techniques in Civil Engineering, chapter 5
- [Forward and backward pass definition](https://www.bctengineer.com/question.md?key=semester_7%2Fproject_engineering%3Aforward-backward-pass) — Project Engineering, chapter 3
