LeaderElection Flashcards
What are distributed algorithms used for?
Leader election, consensus, mutual exclusion, and global predicate evaluation.
What is the purpose of a leader in distributed systems?
To coordinate access to resources, execute specific tasks, or act as an observer for global predicate evaluation.
What are the two main scenarios in leader election?
1) All processes/agents are equally suitable. 2) Some processes/agents are better suited than others.
When are elections needed in distributed systems?
1) System initialization without a leader. 2) Current coordinator crashes or retires. 3) A specific task requires a leader.
What must happen when an election algorithm terminates?
A single process is selected as the leader, and all processes agree on its identity.
What is the main assumption in traditional leader election algorithms?
Every process has a unique ID and knows the IDs of all other processes.
How does the Bully Algorithm work?
Higher-numbered processes “bully” lower-numbered processes out of the election until only one process remains.
What is the complexity of the Bully Algorithm if the highest ID process starts the election?
n-1 messages.
What is the complexity of the Bully Algorithm if the lowest ID process starts the election?
n(n-1) messages.
How does the Ring Algorithm work?
Processes are arranged in a logical ring, and an ELECTION message circulates until it returns to the initiator, who then declares the leader.
What is the complexity of the Ring Algorithm?
2n messages (two full laps around the ring).
Why are traditional leader election algorithms unsuitable for wireless and dynamic systems?
They assume nodes know each other a priori, which excludes dynamic scenarios where processes come and go.
How do wireless election algorithms work?
Any node can initiate an election by sending an ELECTION message to its neighbors, building a spanning tree to elect the most eligible node.
What is distributed aggregation?
Computing an aggregation function (e.g., max, min, average) from the local states of processes.
What is gossiping in distributed aggregation?
Processes share and update their knowledge of the aggregation function by periodically exchanging values with neighbors.