- 2071 Shrawan · 3+5 marks
Consensus; highly available service
Short answer
Consensus is reached via a synchronous f+1 round protocol: each process starts with its proposal in a set, multicasts unsent values each round, merges received values, and after the final round all decide the same value (e.g., minimum). High availability is achieved through replication: multiple servers with a front-end, primary-backup failover, and heartbeat detection; with n replicas each having failure probability p, availability becomes 1 − p^n (e.g., 99.9875% for p=0.05, n=3).
How to come to consensus in DS? Discuss with an approach, how do you make the distributed system service highly available?
Reaching consensus
Consensus means that all correct processes agree on the same value, though some may fail. Properties: termination (every correct process decides), agreement (same decision), validity (decided value was proposed).
Approach (synchronous system, up to f crash failures):
- Every process Pi holds a proposed value in its set Vi.
- For f+1 rounds, each process multicasts values in its set that it has not sent before.
- Each process merges the values it receives into Vi.
- After round f+1, each process decides by the same function (e.g. minimum value or majority). In at least one of the f+1 rounds no process crashes, and in that round all correct processes learn the same values, so they end up with the same set and agree.
For asynchronous systems with crash failures, Paxos/Raft reach agreement by electing a leader and obtaining acceptance from a majority quorum; for Byzantine faults 3f+1 processes are needed.
Making a service highly available
A service is highly available if clients get a response with high probability even when some servers fail. The approach is replication:
- Keep copies of the data and service on several servers, preferably on different machines, networks and sites.
- A front end (proxy) sends client requests to the replicas, and may send to several, taking the first reply.
- Primary-backup or active replication keeps replicas consistent; with the primary down, a backup is promoted by an election/consensus (e.g. bully algorithm) without service interruption.
- Use of heartbeat failure detection, automatic failover, load balancing, and (lazy) update propagation, as in the gossip architecture, where any replica can respond.
- Availability with n replicas each with failure probability p is 1 − pⁿ; e.g. with p = 0.05 and 3 replicas: 1 − 0.000125 = 99.9875%.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Central coordinator election; consensus · Distributed System, chapter 6
- Need of consensus; Bully algorithm · Distributed System, chapter 6
- DS as a single coherent system · Distributed System, chapter 1 · asked 2×
- One election technique; consensus steps · Distributed System, chapter 6
- Need of multicast and consensus · Distributed System, chapter 6
- Autonomous vs distributed system · Distributed System, chapter 1
- Distributed system in big data example · Big Data Technologies, chapter 1
- Short note: Distributed system implementation · Object Oriented Analysis and Design, chapter 4
- Distributed system and Hadoop · Information System, chapter 8
- Unfair service centre simulation · Data Structure and Algorithm, chapter 2