Leaderelection
Leaderelection is the process in distributed systems of designating a single process as the coordinator for tasks requiring centralized control, such as resource management, request routing, or shared state replication. Electing a leader helps avoid conflicts, reduce contention, and provide a single point for implementing linearizable operations. In practice, leaderelection must cope with node failures, network delays, and partitions, often in asynchronous or partially synchronous environments. Correctness typically requires safety (no more than one leader at a time) and liveness (a leader is eventually chosen).
- Bully algorithm: nodes with higher identifiers can force themselves into leadership when a higher-id node fails.
- Ring (Chang and Roberts) algorithm: a token or ID circulates around a ring until the highest-ID
- Consensus-based methods: leaders are elected as part of a broader consensus protocol such as Paxos or
- ZooKeeper and Zab-based elections: coordination services perform leader election to coordinate metadata and client interactions.
Assumptions and trade-offs: many algorithms assume crash faults (not Byzantine), reliable message delivery or bounded delays,