- 2076 Chaitra · 2+4+2 marks
Fault; primary-backup vs active
Short answer
A fault is a defect causing error/failure. Primary-backup replication: one primary processes requests, updates backups, replies after acks; on failure, a backup is elected. It differs from active replication: only primary executes requests, state transfer needed, failover delay, tolerates only crash faults; active replication multicasts to all replicas in total order, masks failures immediately, and can handle Byzantine faults with voting.
What is fault? How to implement primary-backup replica system? How is it different from active replication?
Fault
A fault is the defect or cause (a broken component, a software bug, a bad link) that may lead to an error, an incorrect internal state. An error that reaches the service interface and makes the system deviate from its specification is a failure. Faults are classified as transient (occur once and vanish), intermittent (appear and disappear repeatedly) and permanent (persist until the component is repaired).
Primary-backup replication
In primary-backup (passive) replication, one replica is the primary and the others are backups. Clients send requests only to the primary.
- The primary receives the request, executes it and updates its state.
- It sends the state update (or the request with its result) to all backups and waits for their acknowledgements.
- It then replies to the client.
- Backups only keep their copies up to date; they do not process client requests.
- If the primary fails (detected by heartbeat/timeout), the backups elect a new primary (e.g. the one with the lowest id, or the most up-to-date one) and clients are redirected to it.
Client --> Primary --update--> Backup 1
| --update--> Backup 2
v
reply to client
All writes are ordered at the primary, so consistency is easy to achieve (the service is linearizable while the primary is correct). The drawbacks are the delay of waiting for the backups and the switch-over time when the primary fails. It tolerates K crash failures with K+1 replicas, but cannot handle Byzantine failures.
Difference from active replication
| Point | Primary-backup | Active replication |
|---|---|---|
| Who processes requests | Only the primary | All replicas |
| Request delivery | To primary only | Multicast to all, in the same total order |
| State transfer | Primary sends updates to backups | None; each replica executes the same operations |
| Failure of a replica | Switch-over needed if the primary fails | Masked immediately; others continue |
| Determinism | Not required | Operations must be deterministic |
| Overhead | Less CPU, update messages | More CPU; needs totally ordered multicast |
| Failure types | Crash only | Can handle arbitrary failures with voting |
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Replication objectives; primary-backup · Distributed System, chapter 7
- Passive vs active replication; availability · Distributed System, chapter 7 · asked 2×
- Active vs passive; active replication working · Distributed System, chapter 7
- Reasons for replication; active replication · Distributed System, chapter 7 · asked 2×
- Replication, fault tolerance, scalability · Distributed System, chapter 7
- Reasons for replication; fault tolerant services · Distributed System, chapter 7
- Primary and backup protection · Switchgear and Protection, chapter 1 · asked 3×
- File system layout, i-node, backup · Operating System, chapter 5
- Zones and backup for breaker 7 failure · Switchgear and Protection, chapter 1