---
title: "Fault; primary-backup vs active"
subject: "Distributed System"
chapter: 7
key: "semester_7/distributed_system:fault-primary-backup-active"
source: https://www.bctengineer.com/q/semester_7/distributed_system/fault-primary-backup-active
site: BCT Engineering
---

# Fault; primary-backup vs active

Distributed System · Chapter 7: Replication

- Asked in: 2076 Chaitra, 2+4+2 marks
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_7/distributed_system/fault-primary-backup-active
- Whole chapter: https://www.bctengineer.com/md/semester_7/distributed_system/chapter-7

## Question

What is fault? How to implement primary-backup replica system? How is it different from active replication?

## 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.

## Answer

#### 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.
1. The primary receives the request, executes it and updates its state.
2. It sends the **state update** (or the request with its result) to all backups and waits for their acknowledgements.
3. It then replies to the client.
4. Backups only keep their copies up to date; they do not process client requests.
5. 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.

```text
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 |

## Check yourself

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

1. Which correctly orders the terms: cause, incorrect internal state, deviation visible at the service interface?
   A. Failure, error, fault
   B. Error, fault, failure
   C. Fault, error, failure
   D. Fault, failure, error
   Answer: C. A fault is the defect, it may lead to an error (incorrect internal state), and an error reaching the interface causes a failure. (Key point: Fault vs error vs failure)

2. A fault that appears and disappears repeatedly is called:
   A. Transient
   B. Intermittent
   C. Permanent
   D. Byzantine
   Answer: B. Transient faults occur once and vanish, intermittent ones come and go repeatedly, and permanent ones persist until repair. (Key point: Fault types)

3. In primary-backup replication, what do the backups do?
   A. Process client requests in parallel with the primary
   B. Only keep their copies up to date from the primary's updates
   C. Vote on every reply
   D. Order the requests
   Answer: B. Clients contact only the primary; backups just receive state updates and stand ready to take over. (Key point: Who handles client requests)

4. Which is a true difference between primary-backup and active replication?
   A. Active replication needs deterministic operations and totally ordered multicast; primary-backup does not
   B. Primary-backup can handle Byzantine failures; active cannot
   C. In primary-backup all replicas execute the request
   D. Active replication needs a switch-over when any replica fails
   Answer: A. In active replication every replica executes the same operations in the same order, so determinism and ordered multicast are required; failures are masked immediately. (Key point: Primary-backup vs active difference)

## Related in Distributed System

- [Replication objectives; primary-backup](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Areplication-objectives-primary-backup) — Distributed System, chapter 7
- [Passive vs active replication; availability](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Apassive-vs-active-available) — Distributed System, chapter 7, asked 2×
- [Active vs passive; active replication working](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aactive-passive-working) — Distributed System, chapter 7
- [Reasons for replication; active replication](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Aactive-replication-reasons) — Distributed System, chapter 7, asked 2×
- [Replication, fault tolerance, scalability](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Areplication-scalability-ft) — Distributed System, chapter 7
- [Reasons for replication; fault tolerant services](https://www.bctengineer.com/question.md?key=semester_7%2Fdistributed_system%3Areplication-reasons-ft-services) — Distributed System, chapter 7

## Related in other subjects

- [Primary and backup protection](https://www.bctengineer.com/question.md?key=semester_6%2Fswitchgear_and_protection%3Aprimary-and-backup-protection) — Switchgear and Protection, chapter 1, asked 3×
- [File system layout, i-node, backup](https://www.bctengineer.com/question.md?key=semester_6%2Foperating_system%3Afs-layout-inode-backup) — Operating System, chapter 5
- [Zones and backup for breaker 7 failure](https://www.bctengineer.com/question.md?key=semester_6%2Fswitchgear_and_protection%3Azones-backup-breaker-7) — Switchgear and Protection, chapter 1
