Operating Systems · UGC NET: Distributed Systems
Distributed Design Issues and Robustness
Overview
A distributed system is a set of autonomous computers, connected by a network, that cooperate so that users see one coherent system rather than a collection of machines.
Because the nodes share no memory and no common clock, every coordination problem — naming, sharing, ordering, agreeing — must be solved on top of messages that can be delayed, lost or duplicated.
The design issues are the recurring engineering problems that every such system must solve: transparency, openness, heterogeneity, scalability, concurrency, security and fault handling.
Robustness is the subset of those issues that asks: what happens when a node, link, process or message fails, and how do we keep the service correct and available anyway.
Prerequisites: processes and their states, client–server structuring, and the idea that inter-process communication across machines happens only by message passing.
Key concepts
- Distributed system: loosely coupled hardware (each node has its own CPU and memory) held together by tightly coupled software (a single-system image), with communication by message passing only — no shared memory, no global clock.
A distributed operating system therefore is tightly coupled OS software on loosely coupled hardware. - Transparency: the property that a distributed system hides its distribution from users and programmers. The RM-ODP / Tanenbaum–van Steen list of eight:
- Access transparency — local and remote resources are accessed with identical operations.
- Location transparency — users and application programmers need not know where a resource is; they treat data as if it were at one location. The database manager/administrator may still know placement.
- Migration transparency — resources may move without users noticing.
- Relocation transparency — a resource may move while it is in use.
- Replication transparency — multiple copies exist but the user sees one logical resource.
- Concurrency transparency — several users share a resource without interfering.
- Failure transparency — failures are masked, so tasks are completed despite them.
- Persistence transparency — the location of data in memory or on disk is hidden.
- Openness: published interfaces, so components from different vendors interoperate, are portable, and can be extended without breaking others.
- Heterogeneity: differences in hardware, operating systems, networks and programming languages, hidden by middleware (CORBA, DCOM, RMI, MPI, PVM).
- Scalability: the capacity to absorb increased service load. Three dimensions — size (more users/nodes), geographical (more distance), administrative (more independent organisations).
Techniques: hide latency (asynchronous communication), distribute data and computation (partitioning, naming hierarchies), replicate and cache (at a consistency cost).
Centralised service, centralised data or a centralised algorithm are the classic bottlenecks. - Concurrency: many clients act at once; the danger is the lost update and inconsistent reads. Distributed mutual exclusion is the standard remedy.
- Robustness: ability to keep providing service despite faults (a fault causes an error, which may cause a failure — a deviation from specified behaviour).
Achieved by redundancy, replication, detection, recovery and reconfiguration. - Failure models (hierarchical, each includes the previous):
- Crash / fail-stop — the process halts and stays halted; detectable in a synchronous system.
- Fail-silent (crash with omission) — additionally may fail to send or receive messages (send-omission, receive-omission).
- Timing (performance) failure — the reply arrives, but too early or too late.
- Value/response failure — the reply is wrong in content.
- Byzantine (arbitrary) failure — the node may do anything, including lie and act maliciously; the worst model.
- Failure detection: a monitor sends a probe or expects a heartbeat and declares failure when no reply arrives within a timeout. Timeouts trade detection latency against false suspicion: too short a timeout suspects a live node (false positive), too long a timeout wastes time (false negative / slow detection).
- Completeness and accuracy of a failure detector: strong completeness — every faulty process is eventually suspected by every correct process; strong accuracy — no correct process is ever suspected.
A perfect (P) detector has both; an eventually perfect (◇P) detector has strong completeness and only eventual strong accuracy; ◇S weakens accuracy to one correct process.
Under asynchronous timing no detector can be both complete and accurate with a bounded timeout (the FLP impossibility result, Fischer–Lynch–Paterson 1985: no deterministic consensus with one crash failure). - Replication: keeping multiple copies to raise availability and read throughput; the price is consistency. Quorum consensus (Gifford): with replicas, a write must reach copies and a read must contact copies.
- Reconfiguration: after a failure, the system changes its membership, promotes a backup, shifts load and updates the view. Reconfiguration must itself be consistent to avoid split brain.
- Stateless vs stateful server: a stateless server keeps no client-specific state, so a client crash needs no cleanup and a server crash is easy to recover; a stateful server keeps state (open file, lock, transaction) and is vulnerable to both crashes.
- Two-phase commit (2PC) — the standard atomic commit protocol: a coordinator first prepares all participants (phase 1: each votes YES/READY or NO/ABORT), then commits or aborts all of them (phase 2).
It is blocking: if the coordinator crashes after participants voted YES, they hold locks and cannot decide alone. - Checkpointing: periodically saving process state (plus message logging) so recovery can restart from the last consistent point; coordinated checkpointing avoids orphan messages.
- Byzantine fault tolerance needs replicas to outvote faulty ones (the PBFT bound).
- Caching a remote resource locally improves latency but can return a stale read; fixes are invalidation, update propagation and leases.
How it works
A. Failure detection and reconfiguration loop
- Each node periodically sends a heartbeat or probe to a monitored peer.
- The monitor starts a timer; it computes the timeout from the maximum expected round-trip delay plus jitter plus processing, plus a safety margin.
- If a reply arrives within the timeout, mark the peer alive and restart the timer.
- If not, mark the peer suspected; probe an alternate path or ask witness nodes to avoid acting on one dropped packet.
- If suspicion is confirmed, trigger reconfiguration: update membership, promote a replica, redistribute work.
- If the peer answers later, it must resynchronise state; this is why restarting a suspected node is delayed a little more.
B. Quorum read and write
- Fix , , so that ; the read set and every write set then share at least one replica, so a read always meets the latest write.
- Require so two writes cannot both succeed on disjoint sets.
- A write succeeds if replicas acknowledge; a read contacts replicas and returns the value with the highest version.
- Availability follows directly: writes survive failures, reads survive failures.
C. Two-phase commit
- Coordinator writes a begin record to its stable log and sends PREPARE to all participants.
- Each participant checks constraints (locks, constraints, disk space). If all is well it writes ready + its updates to stable storage and votes YES; otherwise it votes NO.
- If every vote is YES, the coordinator writes COMMIT to its stable log, then sends COMMIT; if any vote is NO or times out, it ABORT and sends ABORT.
- Each participant obeys the decision and acknowledges; the coordinator complete when all acknowledgements arrive.
- A participant that has voted YES is in the READY (blocked) state: it cannot unilaterally commit (a peer may have voted NO), nor abort (the coordinator may already have committed).
It must wait for coordinator recovery or run a termination protocol asking other participants. Three-phase commit (3PC) removes blocking, but only under synchronous timing assumptions.
Drawing the diagram…
Drawing the diagram…
Formulas
-
Notation: = number of replicas, = write quorum, = read quorum, = number of simultaneous failures to be tolerated.
-
Read–write overlap:
-
No two conflicting writes: (equivalently )
-
Failures survived by writes: ; by reads:
-
Majority quorum for failures: , with
-
Byzantine quorum:
-
Safe timeout: , where is the maximum round-trip delay, the maximum jitter and the maximum processing time. In a synchronous system with maximum one-way delay and processing time : .
-
Availability of independent replicas each with availability :
Worked examples
Example 1 (quorum, direct). A service has replicas. Find majority quorums and the failure tolerance.
- need and , so and .
- choose . Writes tolerate failures; reads tolerate failures. Check with the formula: , so . Consistent.
Example 2 (hard, two steps). A service has replicas and the designer fixes . Find the smallest legal and the number of failures the service can tolerate.
- .
- reads tolerate failure; writes tolerate . The service as a whole tolerates only simultaneous failure.
Extra check: is satisfied? is false, so two conflicting writes could both succeed; a correct design would use , for one-failure tolerance. Note that even is wasteful: 4 replicas give the same tolerance as 3.
Example 3 (numeric, timeout and false suspicion). A detector probes every 200 ms. The maximum round-trip delay to the server is 50 ms, maximum jitter 30 ms, maximum server processing 20 ms. What is the minimum safe timeout, and what happens at 80 ms?
- ms.
- at 80 ms, a reply that legitimately needs ms is declared failed, so the detector raises false suspicions — it reports a live server as dead.
The assertion "a too-short timeout can declare a live server failed" is true, and the reason "network delays are variable" correctly explains it.
(Probing at 200 ms does not remove the problem; the timer, not the probe interval, decides the verdict.)
Example 4 (2PC trace). Coordinator Kavita sends PREPARE to Harish and Farida. Harish votes YES, Farida votes YES, and then Kavita crashes before writing any decision to her log.
- both participants are in READY, holding locks on the accounts involved.
- Harish cannot commit — Farida might in principle have voted NO, and a commit is irreversible. He cannot abort either — Kavita may have committed already.
- the only safe action is to wait for Kavita's recovery (or run a termination protocol). When Kavita restarts, she reads her log; since no decision was recorded, she is free to abort and informs both.
Conclusion: 2PC is blocking; a coordinator crash after the YES votes leaves participants blocked until recovery.
Example 5 (statement type). Statement I: Replication improves availability but can create consistency problems. Statement II: Caching a remote resource locally can serve stale data.
Evaluation: I is true — several copies let reads succeed when one is down, but copies drift apart. II is true — a cached copy is not updated until invalidation or expiry.
They are both true, but II does not explain I; each is an independent consequence of keeping duplicate data.
Example 6 (availability). Three independent replicas each with availability 0.9. . The assumption of independence is essential: replicas on the same power supply or subnet do not multiply availability this way.
Comparison
| Failure model | Behaviour | Typical cause | What the designer must add |
|---|---|---|---|
| Crash / fail-stop | Halts and stays halted | Power loss, kill | Detection plus restart |
| Omission (fail-silent) | Drops some messages | Buffer overflow, congestion | Timeouts, retransmission |
| Timing | Reply arrives too late/early | Load, clock drift | Deadlines, bounded retry |
| Value / response | Wrong result returned | Software bug | Checksums, voting, assertions |
| Byzantine (arbitrary) | Any behaviour, lies | Intrusion, hardware fault | replication, signed messages |
| Aspect | Stateless server | Stateful server |
|---|---|---|
| Client state on server | None | Kept (locks, open files, sessions) |
| Client crash | Harmless | Server must detect and clean up |
| Server crash | Simple restart | State lost unless checkpointed or replicated |
| Suitability | Idempotent reads, HTTP-style access | Transactions, file locking, caching |
| Performance | More repeated work | Fewer messages, better caching |
| Feature | 2PC | 3PC |
|---|---|---|
| Phases | Prepare, commit | Can-commit, pre-commit, commit |
| Blocking on coordinator crash | Yes, after YES votes | No, under synchronous timing |
| Message cost | Lower | Higher |
| Effect of network partition | Participants may block | Still unsafe under partitions |
| Feature | Synchronous system | Asynchronous system |
|---|---|---|
| Delay bounds | Known maximum and | Unknown, unbounded |
| Failure detection | Timeout is exact | Timeout can only guess |
| Consensus | Solvable with crash failures | FLP: no deterministic solution with one crash |
| Practical consequence | Timeouts safe | Heartbeats give suspicion, not proof |
| Transparency | Live example | What is hidden |
|---|---|---|
| Access | Same call for local/remote file read | Differences in access mechanism |
| Location | File name gives no server address | Physical location |
| Migration | Data moved to a new server | Movement of resource |
| Relocation | Data moved while Ramesh is using it | Movement during use |
| Replication | One logical file, three copies | Number and identity of copies |
| Concurrency | Two clerks update stock at once | Concurrent access |
| Failure | Retry hides a lost node | Failure and recovery |
| Persistence | Object exists on disk or in RAM | Storage medium |
Revision summary
- Distributed system = loosely coupled hardware + tightly coupled software + message passing.
- Location transparency is for users and programmers; the manager/administrator may still know placement.
- Quorum: for read–write overlap; to stop conflicting writes.
- Majority quorums: , ; Byzantine needs .
- Timeout too short → false suspicion; too long → slow detection.
- Completeness = "all faulty are eventually suspected"; accuracy = "no correct one is suspected".
- Asynchronous system + bounded timeout ⇒ no perfect detector (FLP).
- 2PC is blocking; 3PC is non-blocking only under synchronous assumptions.
- Stateless server ⇒ trivial crash recovery, no client cleanup, but no caching or locking.
- Replication buys availability, costs consistency; caching buys latency, risks stale reads.
- Reconfiguration must be consistent, otherwise split brain and two "primaries".
Previous-year exam insights
- Direct concept questions on transparency, scalability, robustness and failure models are common; answer from the exact definition, not from intuition.
- Statement I/II/III format is the favourite: each statement is judged independently, then the option combining the true ones is chosen.
Read whether the question says only, always, or both. - Location transparency trap: the third party in the list is often "managers" or "database administrators" to make an all-three option attractive — the correct answer excludes them.
- Match List-I with List-II pairs terms (heartbeat, quorum, 2PC, checkpointing, false suspicion, stale read) with one-line descriptions; learn one crisp description per term.
- Assertion–Reason items usually test the timeout/false-suspicion and replication/consistency links; check whether the reason actually explains the assertion, not merely whether each is true.
- Numeric questions on quorums and timeouts are pure formula application; write the inequality first, then substitute, and state whether the answer is the read tolerance or the write tolerance.
- Code/trace questions on failure detectors ask what the loop returns when the reply is delayed beyond ; the answer is FAILED even though the peer is alive — a false suspicion.
- Classic traps: "replication always improves consistency", "2PC never blocks", "stateless servers cannot be available", and swapping completeness with accuracy.
Practice at PARIKSHA
You are ready for the PARIKSHA tests of this sub-topic when you can:
- Name and define all eight transparencies and give a one-line example of each.
- Explain why location transparency does not require the administrator to be ignorant of data placement.
- List the five failure models in order of severity and say which one makes agreement hardest.
- Compute , and the tolerated failures for a given , including the even- case.
- Derive a safe timeout from round-trip delay, jitter and processing time, and explain false suspicion.
- Distinguish completeness from accuracy, and perfect from eventually perfect detectors.
- Trace a two-phase commit where the coordinator crashes after all YES votes and state the blocking outcome.
- Compare stateless and stateful servers on client crash, server crash and recoverability.
- Explain how replication, caching, checkpointing and reconfiguration each contribute to robustness.
- Decide truth value for a two-statement item on replication and consistency, and for an assertion–reason item on timeouts.
Attempt the sub-topic test on Distributed Design Issues And Robustness first; when you score comfortably, move to the full subject test.