1. Gyanastra
  2. Operating Systems
  3. UGC NET: Distributed Systems
  4. Distributed Design Issues and Robustness
Free lesson, no account needed 16 min read 25 practice questions after it
Asked in past papers3 times
  • UGC NET201720142013

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 NN replicas, a write must reach WW copies and a read must contact RR 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 N≥3f+1N \ge 3f + 1 replicas to outvote ff 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

  1. Each node periodically sends a heartbeat or probe to a monitored peer.
  2. The monitor starts a timer; it computes the timeout from the maximum expected round-trip delay plus jitter plus processing, plus a safety margin.
  3. If a reply arrives within the timeout, mark the peer alive and restart the timer.
  4. If not, mark the peer suspected; probe an alternate path or ask witness nodes to avoid acting on one dropped packet.
  5. If suspicion is confirmed, trigger reconfiguration: update membership, promote a replica, redistribute work.
  6. 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

  1. Fix NN, RR, WW so that R+W>NR + W > N; the read set and every write set then share at least one replica, so a read always meets the latest write.
  2. Require W>N/2W > N/2 so two writes cannot both succeed on disjoint sets.
  3. A write succeeds if WW replicas acknowledge; a read contacts RR replicas and returns the value with the highest version.
  4. Availability follows directly: writes survive N−WN-W failures, reads survive N−RN-R failures.

C. Two-phase commit

  1. Coordinator writes a begin record to its stable log and sends PREPARE to all participants.
  2. 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.
  3. 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 log⁡s\log s ABORT and sends ABORT.
  4. Each participant obeys the decision and acknowledges; the coordinator log⁡s\log s complete when all acknowledgements arrive.
  5. 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.
Figure. It shows a reply within timeout marking the peer alive; otherwise failure is suspected, witnesses or an alternate path are asked, and only confirmed death triggers reconfiguration and replica promotion. A later reply requires resynchronisation.
Figure. Notice that both participants vote YES before the coordinator sends COMMIT to both. The diagram shows the success path; the protocol text notes that a YES-voting participant is READY and must wait for the decision.

Formulas

  • Notation: NN = number of replicas, WW = write quorum, RR = read quorum, ff = number of simultaneous failures to be tolerated.

  • Read–write overlap: R+W>NR + W > N

  • No two conflicting writes: W>N2W > \dfrac{N}{2} (equivalently 2W>N2W > N)

  • Failures survived by writes: N−WN - W; by reads: N−RN - R

  • Majority quorum for ff failures: N≥2f+1N \ge 2f + 1, with R=W=f+1R = W = f + 1

  • Byzantine quorum: N≥3f+1N \ge 3f + 1

  • Safe timeout: Ttimeout≥RTTmax⁡+Jmax⁡+TprocT_{\text{timeout}} \ge RTT_{\max} + J_{\max} + T_{\text{proc}}, where RTTmax⁡RTT_{\max} is the maximum round-trip delay, Jmax⁡J_{\max} the maximum jitter and TprocT_{\text{proc}} the maximum processing time. In a synchronous system with maximum one-way delay DD and processing time PP: Ttimeout>2D+PT_{\text{timeout}} > 2D + P.

  • Availability of kk independent replicas each with availability AA: Asys=1−(1−A)kA_{\text{sys}} = 1 - (1 - A)^{k}

Worked examples

Example 1 (quorum, direct). A service has N=5N = 5 replicas. Find majority quorums and the failure tolerance.

  1. need R+W>5R + W > 5 and W>2.5W > 2.5, so W≥3W \ge 3 and R≥3R \ge 3.
  2. choose R=W=3R = W = 3. Writes tolerate 5−3=25 - 3 = 2 failures; reads tolerate 5−3=25 - 3 = 2 failures. Check with the formula: N≥2f+1⇒5≥5N \ge 2f+1 \Rightarrow 5 \ge 5, so f=2f = 2. Consistent.

Example 2 (hard, two steps). A service has N=4N = 4 replicas and the designer fixes W=2W = 2. Find the smallest legal RR and the number of failures the service can tolerate.

  1. R+2>4⇒R>2⇒R=3R + 2 > 4 \Rightarrow R > 2 \Rightarrow R = 3.
  2. reads tolerate N−R=1N - R = 1 failure; writes tolerate N−W=2N - W = 2. The service as a whole tolerates only min⁡(1,2)=1\min(1, 2) = 1 simultaneous failure.
    Extra check: is W>N/2W > N/2 satisfied? 2>22 > 2 is false, so two conflicting writes could both succeed; a correct design would use W=3W = 3, R=3R = 3 for one-failure tolerance. Note that even NN 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?

  1. Ttimeout≥50+30+20=100T_{\text{timeout}} \ge 50 + 30 + 20 = 100 ms.
  2. at 80 ms, a reply that legitimately needs 50+30+20=10050 + 30 + 20 = 100 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.

  1. both participants are in READY, holding locks on the accounts involved.
  2. Harish cannot commit — Farida might in principle have voted NO, and a commit is irreversible. He cannot abort either — Kavita may have committed already.
  3. 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. Asys=1−(1−0.9)3=1−0.001=0.999A_{\text{sys}} = 1 - (1-0.9)^3 = 1 - 0.001 = 0.999. The assumption of independence is essential: replicas on the same power supply or subnet do not multiply availability this way.

Comparison

Failure modelBehaviourTypical causeWhat the designer must add
Crash / fail-stopHalts and stays haltedPower loss, killDetection plus restart
Omission (fail-silent)Drops some messagesBuffer overflow, congestionTimeouts, retransmission
TimingReply arrives too late/earlyLoad, clock driftDeadlines, bounded retry
Value / responseWrong result returnedSoftware bugChecksums, voting, assertions
Byzantine (arbitrary)Any behaviour, liesIntrusion, hardware fault3f+13f+1 replication, signed messages
AspectStateless serverStateful server
Client state on serverNoneKept (locks, open files, sessions)
Client crashHarmlessServer must detect and clean up
Server crashSimple restartState lost unless checkpointed or replicated
SuitabilityIdempotent reads, HTTP-style accessTransactions, file locking, caching
PerformanceMore repeated workFewer messages, better caching
Feature2PC3PC
PhasesPrepare, commitCan-commit, pre-commit, commit
Blocking on coordinator crashYes, after YES votesNo, under synchronous timing
Message costLowerHigher
Effect of network partitionParticipants may blockStill unsafe under partitions
FeatureSynchronous systemAsynchronous system
Delay boundsKnown maximum DD and PPUnknown, unbounded
Failure detectionTimeout is exactTimeout can only guess
ConsensusSolvable with crash failuresFLP: no deterministic solution with one crash
Practical consequenceTimeouts safeHeartbeats give suspicion, not proof
TransparencyLive exampleWhat is hidden
AccessSame call for local/remote file readDifferences in access mechanism
LocationFile name gives no server addressPhysical location
MigrationData moved to a new serverMovement of resource
RelocationData moved while Ramesh is using itMovement during use
ReplicationOne logical file, three copiesNumber and identity of copies
ConcurrencyTwo clerks update stock at onceConcurrent access
FailureRetry hides a lost nodeFailure and recovery
PersistenceObject exists on disk or in RAMStorage medium

Revision summary

  1. Distributed system = loosely coupled hardware + tightly coupled software + message passing.
  2. Location transparency is for users and programmers; the manager/administrator may still know placement.
  3. Quorum: R+W>NR + W > N for read–write overlap; W>N/2W > N/2 to stop conflicting writes.
  4. Majority quorums: N=2f+1N = 2f+1, R=W=f+1R = W = f+1; Byzantine needs N≥3f+1N \ge 3f+1.
  5. Timeout too short → false suspicion; too long → slow detection.
  6. Completeness = "all faulty are eventually suspected"; accuracy = "no correct one is suspected".
  7. Asynchronous system + bounded timeout ⇒ no perfect detector (FLP).
  8. 2PC is blocking; 3PC is non-blocking only under synchronous assumptions.
  9. Stateless server ⇒ trivial crash recovery, no client cleanup, but no caching or locking.
  10. Replication buys availability, costs consistency; caching buys latency, risks stale reads.
  11. 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 TT; 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:

  1. Name and define all eight transparencies and give a one-line example of each.
  2. Explain why location transparency does not require the administrator to be ignorant of data placement.
  3. List the five failure models in order of severity and say which one makes agreement hardest.
  4. Compute RR, WW and the tolerated failures for a given NN, including the even-NN case.
  5. Derive a safe timeout from round-trip delay, jitter and processing time, and explain false suspicion.
  6. Distinguish completeness from accuracy, and perfect from eventually perfect detectors.
  7. Trace a two-phase commit where the coordinator crashes after all YES votes and state the blocking outcome.
  8. Compare stateless and stateful servers on client crash, server crash and recoverability.
  9. Explain how replication, caching, checkpointing and reconfiguration each contribute to robustness.
  10. 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.

Pages 1–2 of 2