Distributed Computing

Chapter 5
Coordination, Consensus and Membership

Post Graduate Program in IT Engineering
Distributed Computing   •   Post Graduate

Coordination, Consensus and Membership

Introduction

Distributed systems coordinate processes that have no shared clock, communicate through networks that may delay or lose messages, and may fail independently. Coordination mechanisms determine who may act, in what order, and with what authority. Consensus mechanisms make replicas agree on one value despite failures. Membership mechanisms determine which processes are currently expected to participate. These problems are closely related: a consensus protocol needs a defined membership, leader election often improves liveness, and mutual exclusion requires agreement about ownership of a resource.

This chapter develops the safety and liveness properties of these mechanisms, compares crash-failure and Byzantine models, and examines Paxos, Raft, quorum systems, failure detectors, reconfiguration, and impossibility results.

Learning Objectives

After studying this chapter, students should be able to:

1. Distinguish safety, liveness, fault tolerance, and failure models.

2. Design and evaluate leader-election and mutual-exclusion mechanisms.

3. Derive quorum-intersection conditions and Byzantine quorum thresholds.

4. Explain Paxos and Raft, including their safety arguments and liveness assumptions.

5. Analyse group membership and safe reconfiguration.

6. Explain failure-detector classes, including ♦S and Ω.

7. State the FLP impossibility result and its engineering consequences.

8. Evaluate consensus protocols in practical and governance contexts.

1. Coordination as a Distributed-Systems Problem

A distributed execution consists of processes, messages, local state, and events. A process may crash, a message may be delayed or duplicated, and clocks may not be synchronized. Unless a timing model is explicitly assumed, a process cannot distinguish a crashed peer from one that is merely slow.

Two properties organize protocol analysis:

  • Safety: nothing bad happens. For example, two correct processes are never simultaneously granted the same exclusive lock, and two correct replicas never decide different values.
  • Liveness: something good eventually happens. For example, a request is eventually granted or a correct process eventually decides.

Safety is normally required under all allowed executions. Liveness usually requires additional assumptions, such as eventual message delivery, a stable leader, or a period of synchrony. A protocol that sacrifices safety during a network partition is not made correct merely because it improves availability.

The failure model is equally important. In the crash-stop model, a process stops permanently. In crash-recovery, it can restart and must recover durable state. In the omission model, messages or actions may be lost. A Byzantine process can behave arbitrarily, including sending inconsistent statements to different peers.

2. Leader Election and Mutual Exclusion

2.1 Leader election

A leader coordinates actions such as log replication, membership changes, or lock acquisition. Typical election properties are:

  • Uniqueness: at most one leader is recognized for a given term or epoch.
  • Eventual leadership: if failures cease and communication becomes sufficiently reliable, a correct leader is eventually selected.
  • Leader validity: the elected leader satisfies eligibility rules, such as possessing the most up-to-date log.

The bully algorithm elects the highest-identifier reachable process. It is simple but can generate many messages and behaves poorly under unreliable failure detection. Ring algorithms circulate election information around a logical ring and can reduce some contention, but membership changes complicate the ring. Modern replicated services commonly use randomized timeouts and terms, as in Raft, to avoid repeated simultaneous elections.

No leader election algorithm can guarantee perfect knowledge in a fully asynchronous system with crash failures. It can provide useful eventual behaviour only under assumptions about communication or through an unreliable failure detector.

2.2 Mutual exclusion

Distributed mutual exclusion ensures that at most one process is in a critical section. Its safety condition is:

\[

\forall t,\quad |CS(t)|\leq 1.

\]

Important designs include:

  • Centralized coordinator: a coordinator grants a token or permission. It is efficient in normal operation but creates a bottleneck and a single failure point.
  • Token-based algorithms: possession of a unique token grants entry. Safety follows from token uniqueness; recovery from token loss or duplication is difficult.
  • Permission-based algorithms: a process collects permissions from other processes, often using timestamps. They avoid a single coordinator but require more messages and careful recovery.
  • Quorum locking: a request obtains a quorum of votes. Safety requires that two conflicting quorums intersect in a process that cannot grant conflicting permissions simultaneously.

A mutual-exclusion service must define behaviour during partition. Granting access independently in both partitions improves availability but violates safety unless the resource itself supports fencing, leases, or another external safeguard. Leases also require bounded clock error and bounded message delay for their time-based interpretation; otherwise an expired-looking lease may still be valid at another node.

3. Quorum Systems

Let there be \(N\) replicas. A read quorum has size \(R\), and a write quorum has size \(W\). The familiar quorum conditions are:

\[

R+W>N \quad\text{and}\quad 2W>N.

\]

The first guarantees that every read quorum intersects every write quorum. The second guarantees that any two write quorums intersect. These are different requirements. If only one writer exists, write-write intersection may be unnecessary for a particular application; for general replicated writes it is essential.

Derivation. Two subsets of an \(N\)-element universe with sizes \(a\) and \(b\) must intersect if \(a+b>N\). If they were disjoint, their union would contain \(a+b>N\) elements, which is impossible. Substituting \(a=R,b=W\) gives read-write intersection; substituting \(a=b=W\) gives write-write intersection.

For \(N=5\), a common choice is \(R=3,W=3\): \(R+W=6>5\) and \(2W=6>5\). A read can therefore observe a write quorum, and two writes overlap. A system requiring availability during a partition may deliberately weaken consistency, but it must state the resulting semantics rather than claim quorum-based strong consistency.

Weighted quorums assign weight \(w_i\) to replica \(i\). A quorum is a set whose weight reaches a threshold. Correctness requires intersection under the chosen threshold and failure assumptions; simple cardinality formulas cannot automatically be transferred to weighted systems.

4. Group Membership and Reconfiguration

A membership service provides a view: an ordered or identified set of processes expected to participate in a protocol. A view may contain a configuration identifier, members, roles, and transition metadata. Membership is not merely failure detection. A detector may suspect a process, while a membership protocol decides whether the process is excluded from the authoritative configuration.

4.1 View changes

A safe view-change protocol commonly uses:

1. A totally ordered configuration identifier.

2. A rule that only an authorized quorum can install a new view.

3. State transfer before a joining replica serves requests.

4. A barrier or joint configuration preventing old and new configurations from making incompatible decisions.

A naïve replacement of configuration \(C_1\) by \(C_2\) is unsafe if quorums in the two configurations can be disjoint. A decision made under \(C_1\) may then be unknown to participants in \(C_2\). Joint consensus temporarily requires agreement from both the old and new configurations. If \(Q_1\) is an old-configuration quorum and \(Q_2\) is a new-configuration quorum, the transition rule must ensure that any decision possible before the transition intersects the authority needed after the transition, directly or through a committed configuration entry.

For crash-tolerant majority configurations, each configuration normally requires more than half its members for a quorum. Joint consensus requires the transition entry to satisfy both old and new quorum rules. This prevents two successive leaders from safely committing conflicting histories while membership changes.

4.2 Membership and split brain

A network partition can produce two groups that each believe the other has failed. Majority quorums prevent both groups from making progress when the groups are disjoint minorities. Fencing tokens, epoch numbers, and durable term records provide additional protection against delayed messages and rebooted nodes. In storage systems, a stale member must be prevented from writing even if it still possesses old credentials.

5. Failure Detectors

A failure detector supplies suspicions about process failures; it may make mistakes. Chandra and Toueg classify detectors by completeness and accuracy:

  • Strong completeness: eventually every crashed process is permanently suspected by every correct process.
  • Weak completeness: eventually every crashed process is suspected by at least one correct process.
  • Strong accuracy: no correct process is ever suspected.
  • Weak accuracy: some correct process is never suspected.
  • Eventual weak accuracy: after some unknown time, some correct process is never suspected.

The eventually strong failure detector ♦S has strong completeness and eventual weak accuracy. It is not the same as the eventual-leader detector Ω. Ω eventually outputs the same correct process at every correct process; it can be used to obtain a common leader. ♦S provides suspicion information and does not, by definition, require all correct processes eventually to identify the same leader. Under suitable reductions, detector classes can implement one another in particular system models, but their definitions must not be conflated.

Failure detectors are especially useful in partially synchronous systems: although no known bound exists initially, after an unknown stabilization time message delays and processing times have bounds. Timeouts may be too short before stabilization, so false suspicions are tolerated; safety must not depend on treating a suspicion as proof of failure.

6. Consensus and Its Limits

Consensus usually requires:

  • Agreement: no two correct processes decide different values.
  • Validity: a decided value satisfies the protocol's validity rule, commonly that it was proposed by some process.
  • Termination: every correct process eventually decides.

Consensus differs from atomic broadcast, but the two are closely related: a sequence of consensus instances can implement a totally ordered log, while ordered broadcast can often be used to solve repeated agreement.

6.1 FLP impossibility

The FLP result states that in a completely asynchronous message-passing system with even one crash failure, no deterministic consensus protocol can guarantee termination in every execution, although safety may still be guaranteed. The result does not say that consensus is impossible in practice. Practical systems use randomization, partial synchrony, failure detectors, or operational assumptions that exclude the indefinitely delaying execution constructed by FLP.

The theorem is a liveness impossibility, not a statement that agreement cannot be safe. It also does not apply unchanged to synchronous systems, probabilistic algorithms, or models with stronger failure and timing assumptions.

7. Paxos

Paxos is a crash-fault consensus protocol organized around numbered proposals and quorums. The classic roles are proposer, acceptor, and learner, although implementations combine them.

7.1 Basic protocol

A proposer chooses a proposal number \(n\) and sends Prepare(n) to a majority of acceptors. An acceptor promises not to accept proposals numbered less than \(n\), and reports the highest-numbered proposal it has already accepted, if any. After receiving promises from a majority, the proposer must choose:

  • its own proposed value if no acceptor reports an accepted proposal; or
  • the value associated with the highest-numbered accepted proposal reported by the prepare quorum.

It then sends Accept(n,v) to the acceptors that promised. A proposal is chosen when a majority accepts it. Learners discover the decision through accept notifications or other dissemination.

7.2 Safety intuition

Any two majorities intersect. Suppose proposal \((n,v)\) is chosen. A later prepare quorum intersects the earlier accepting majority. The intersecting acceptor has either reported \((n,v)\), or has accepted a higher-numbered proposal whose value was constrained by an earlier prepare quorum. Inductively, later proposals preserve \(v\). This is why selecting an arbitrary previously accepted value is incorrect: it can select a lower-numbered value and break agreement.

Paxos safety requires persistent acceptor promises and accepted proposals across crashes, or an equivalent durable mechanism. A proposer may abandon a round after timeout without violating safety, but repeated pre-emption can harm liveness. Progress generally requires a sufficiently stable proposer, a majority of non-failed acceptors, and eventual communication conditions.

7.3 Multi-Paxos

Multi-Paxos uses a stable leader to amortize the prepare phase across a sequence of log slots. Each slot still requires quorum-based acceptance, and recovery must preserve the ordering and commitment rules. A leader is a performance optimization; it does not remove the need for quorum intersection or durable state.

8. Raft

Raft decomposes consensus into leader election, log replication, and safety. Servers operate in monotonically increasing terms. A candidate requests votes; a server grants at most one vote per term, subject to the candidate's log being at least as up to date according to last-log-term and last-log-index ordering.

A leader appends commands to its log and replicates them with AppendEntries. An entry is committed when replicated on a majority, with additional rules concerning the leader's current term. Followers reject inconsistent prefixes, allowing the leader to repair logs. The leader completeness property states that a committed entry appears in the logs of future leaders. The voting restriction and election restriction support this property.

Raft and Paxos are not identical implementations, but both depend on quorum intersection, persistent metadata, and eventual conditions for liveness. Raft's joint-consensus reconfiguration requires a transition entry accepted under both old and new configurations, preventing independent old and new majorities from committing conflicting entries.

9. Byzantine Agreement

Byzantine consensus must tolerate processes that lie or equivocate. In a signed or authenticated model, signatures can make equivocation detectable, but they do not eliminate the need for enough honest participants. In the classical unauthenticated oral-messages model, deterministic Byzantine agreement requires:

\[

N\geq 3f+1,

\]

where \(f\) is the maximum number of Byzantine processes. The requirement is also expressed as \(f < N/3\). For example, tolerating \(f=2\) requires at least \(N=7\) replicas.

A common Byzantine quorum has size \(2f+1\) when \(N=3f+1\). Two such quorums intersect in at least

\[

(2f+1)+(2f+1)-(3f+1)=f+1

\]

members. Since at most \(f\) are Byzantine, at least one member of the intersection is honest. This honest intersection supports prevention of conflicting certificates. A quorum of \(f+1\) is enough to contain one honest member, but it is not generally enough to guarantee honest intersection between two conflicting certificates.

Authenticated Byzantine protocols may achieve different communication and resilience characteristics, especially with digital signatures, but the protocol's exact assumptions must be stated. Byzantine quorum systems also need validity rules, prepared/commit certificates, and safeguards against equivocation; simply replacing a crash-fault majority with an arbitrary threshold is unsound.

10. Worked Application: Reconfiguring a Replicated Payment Ledger

Background

Consider an illustrative payment ledger replicated by five crash-tolerant servers \(A\) through \(E\). It uses majority quorums of three and a replicated log. Payments must not be applied twice or in conflicting order.

Problem

Server \(E\) is being replaced by \(F\). During the replacement, a network partition separates \(A,B,C\) from \(D,E,F\). A naïve procedure that simply tells the new group to use \(F\) could allow two groups to accept transactions or could cause \(F\) to start with an incomplete log.

Analysis

The old configuration \(C_1=\{A,B,C,D,E\}\) has quorum size three. The new configuration \(C_2=\{A,B,C,D,F\}\) also has quorum size three. Installing \(C_2\) requires a committed configuration entry under the old rules and a transition protocol that requires participation from both configurations. The replacement cannot safely serve until it has received the committed prefix and passed consistency checks.

Approach

The leader appends a joint-configuration entry specifying \(C_1\) and \(C_2\). The entry is replicated according to both configurations. During the joint phase, a commit requires an old quorum and a new quorum. Once the joint entry is committed, the system commits a final entry for \(C_2\), after which \(F\) may serve. Epoch numbers reject delayed writes from old leaders.

Outcome

If only \(A,B,C\) remain connected, the old group may be able to form an old quorum, but it cannot complete all transition requirements unless the protocol explicitly permits that stage. The isolated minority cannot independently install \(C_2\). This reduces availability during reconfiguration but preserves a single authoritative history.

Learning points

Reconfiguration is a consensus problem, not an administrative list update. Membership changes must be ordered, quorum-safe, durable, and coupled to state transfer. Availability claims must identify which configuration and which failure assumptions support progress.

11. Engineering, Governance and Contemporary Practice

Implementations should persist terms, epochs, promises, votes, and accepted log entries before acknowledging decisions. They should expose metrics such as election churn, quorum latency, commit lag, suspected-node duration, and reconfiguration failures. Testing should include message duplication, arbitrary delay, process restart, disk loss, partition healing, clock skew, and delayed packets from previous terms.

Operational policy matters. A membership service controls authority, so access to reconfiguration must be authenticated and audited. In financial, healthcare, and public-sector systems, an incorrect membership change can affect accountability, records, and regulatory evidence. Byzantine settings additionally require key management, certificate rotation, and procedures for compromised identities.

AI-assisted operations can help detect anomalous election churn or predict capacity problems, but automated remediation must not bypass quorum and authorization rules. A predictive model may generate a suspicion; it must not directly authorize an unsafe membership change. Contemporary protocols increasingly combine durable replicated logs, hardware-assisted secure identity, threshold signatures, and formally verified state-machine implementations. These techniques improve performance or assurance but do not remove the need to state assumptions and prove safety.

Chapter Summary

Coordination in distributed systems depends on explicit failure, timing, and membership models. Safety means that conflicting outcomes never occur; liveness means that correct operations eventually progress under suitable assumptions. Leader election supports coordination but cannot provide perfect failure knowledge in a fully asynchronous system. Mutual exclusion may use coordinators, tokens, permissions, or quorum locks, each with distinct failure and availability trade-offs.

Quorum correctness follows from intersection conditions: \(R+W>N\) for read-write intersection and \(2W>N\) for write-write intersection. Membership changes require ordered, quorum-safe reconfiguration, commonly through joint consensus and state transfer. ♦S is an eventually strong failure detector, whereas Ω is an eventual common-leader detector. Paxos preserves safety by selecting the value from the highest-numbered accepted proposal reported by the prepare quorum. Raft uses terms, voting restrictions, log matching, and joint consensus. Byzantine agreement requires stronger thresholds; in the classical unauthenticated model, \(N\geq3f+1\), and Byzantine quorum certificates commonly use \(2f+1\) members. FLP shows that deterministic termination cannot be guaranteed in a fully asynchronous system with one crash failure, motivating partial synchrony, failure detectors, and randomized techniques.

Key Terms

Safety: The property that forbidden outcomes never occur.

Liveness: The property that a correct operation eventually makes progress.

Leader election: Selection of a process to coordinate distributed activity.

Mutual exclusion: Ensuring that conflicting critical-section access does not overlap.

Quorum: A subset of participants sufficient to authorize an operation.

Read quorum: A quorum used to obtain replicated state.

Write quorum: A quorum used to record replicated state.

Group membership: An authoritative view of participating processes.

Reconfiguration: A controlled change from one membership configuration to another.

Failure detector: A mechanism that reports suspicions about process failures.

♦S: Failure detector with strong completeness and eventual weak accuracy.

Ω: Eventual-leader failure-detector class.

Consensus: Agreement on a value satisfying agreement, validity, and termination requirements.

Paxos: Quorum-based crash-fault consensus protocol using numbered proposals.

Raft: Consensus protocol organized around terms, elections, and replicated logs.

Byzantine fault: Arbitrary or malicious process behaviour.

FLP impossibility: Result ruling out guaranteed deterministic termination under full asynchrony with one crash failure.

Joint consensus: Reconfiguration method requiring compatibility between old and new configurations.

Fencing token: An epoch or credential that prevents stale members from acting.

Review Questions

Short Answer Questions

1. Distinguish safety from liveness and give one example of each.

2. Why are both \(R+W>N\) and \(2W>N\) relevant to general replicated storage?

3. State the completeness and accuracy properties of ♦S.

4. What information must a Paxos proposer select after a successful prepare phase?

5. Why does a Byzantine quorum of \(2f+1\) intersect another such quorum in an honest process when \(N=3f+1\)?

Long Answer Questions

1. Compare centralized, token-based, and quorum-based mutual exclusion, including failure and availability trade-offs.

2. Explain Paxos safety and liveness, including the role of persistent acceptor state and a stable proposer.

3. Compare Paxos and Raft in terms of roles, leadership, log replication, and reconfiguration.

4. Explain group membership, state transfer, epochs, and joint consensus as a safe reconfiguration strategy.

5. State FLP precisely and discuss how practical systems obtain useful liveness despite it.

Analytical / Application Questions

1. A system has \(N=7\) replicas and uses \(R=4,W=4\). Verify both quorum-intersection conditions and explain what they imply.

2. Design a safe replacement procedure for one node in a five-node replicated service during a partition. Identify which actions must be blocked and why.

3. A Byzantine service claims to tolerate two faulty replicas using five total replicas and certificates of three signatures. Evaluate the claim under the classical unauthenticated model and propose a corrected design.

Multiple Choice Questions with Answers

Question 1

For general replicated writes, which condition guarantees that any two write quorums intersect?

A. R + W = N

B. R + W > N

C. 2W > N

D. 2R > N

Correct Answer: C. 2W > N

Question 2

What does the failure detector ♦S provide?

A. Strong completeness and eventual weak accuracy

B. Weak completeness and strong accuracy

C. Eventual agreement on one correct leader

D. Perfect accuracy and strong completeness

Correct Answer: A. Strong completeness and eventual weak accuracy

Question 3

After a successful Paxos prepare phase reports previously accepted proposals, how must the proposer choose its value?

A. Choose the newest value according to local wall-clock time

B. Choose any value reported by any acceptor

C. Choose the value from the highest-numbered accepted proposal reported by the prepare quorum

D. Always choose its original client value

Correct Answer: C. Choose the value from the highest-numbered accepted proposal reported by the prepare quorum

Question 4

In the classical unauthenticated Byzantine model, how many replicas are required to tolerate f Byzantine faults?

A. N ≥ 2f + 1

B. N ≥ 3f + 1

C. N ≥ 4f + 1

D. N ≥ f + 1

Correct Answer: B. N ≥ 3f + 1

Question 5

For N = 5 replicas, which pair satisfies both read-write and write-write quorum intersection?

A. R = 2, W = 2

B. R = 2, W = 3

C. R = 3, W = 3

D. R = 4, W = 1

Correct Answer: C. R = 3, W = 3

Question 6

What is the central liveness limitation identified by FLP?

A. No protocol can preserve safety under one crash failure

B. No deterministic protocol guarantees termination in a fully asynchronous system with one crash failure

C. Byzantine consensus is impossible with digital signatures

D. Majority quorums cannot intersect in asynchronous systems

Correct Answer: B. No deterministic protocol guarantees termination in a fully asynchronous system with one crash failure

Question 7

Why does Raft restrict votes to candidates with sufficiently up-to-date logs?

A. To reduce message size

B. To ensure future leaders contain committed entries

C. To eliminate the need for persistent state

D. To permit minority partitions to commit entries

Correct Answer: B. To ensure future leaders contain committed entries

Question 8

With N = 3f + 1 and Byzantine quorum size 2f + 1, what is the minimum intersection size of two quorums?

A. f

B. f + 1

C. 2f

D. 2f + 1

Correct Answer: B. f + 1

Question 9

What is the principal purpose of joint consensus during reconfiguration?

A. To allow old and new configurations to decide independently

B. To avoid transferring state to new members

C. To connect old and new quorum authorities during the transition

D. To replace durable epochs with wall-clock timestamps

Correct Answer: C. To connect old and new quorum authorities during the transition

Question 10

Which statement correctly distinguishes Ω from ♦S?

A. Ω is an eventual common-leader detector, whereas ♦S has strong completeness and eventual weak accuracy

B. Ω guarantees perfect failure detection, whereas ♦S guarantees no completeness

C. Ω is a quorum rule, whereas ♦S is a Byzantine certificate

D. They are identical definitions with different notation

Correct Answer: A. Ω is an eventual common-leader detector, whereas ♦S has strong completeness and eventual weak accuracy

Distributed Computing
Chapter 5 of 15