0% found this document useful (0 votes)
6 views6 pages

Part 0

The document discusses leader election in distributed systems. Leader election is important for coordination among servers and determining who is responsible for tasks when servers can fail. The document outlines the problem, including what happens when the leader fails, and presents a system model and requirements for the election algorithm.

Uploaded by

manojbaniya727
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views6 pages

Part 0

The document discusses leader election in distributed systems. Leader election is important for coordination among servers and determining who is responsible for tasks when servers can fail. The document outlines the problem, including what happens when the leader fails, and presents a system model and requirements for the election algorithm.

Uploaded by

manojbaniya727
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Why Election?

• Example 1: Your Bank account details are


replicated at a few servers, but one of
these servers is responsible for receiving
all reads and writes, i.e., it is the leader
among the replicas
• What if there are two leaders per customer?
• What if servers disagree about who the leader is?
• What if the leader crashes?
Each of the above scenarios leads to Inconsistency
More motivating examples

• Example 2: Group of NTP servers: who is


the root server?

• Other systems that need leader election:


Apache Zookeeper, Google’s Chubby
• Leader is useful for coordination among
distributed servers
Leader Election Problem

• In a group of processes, elect a Leader to


undertake special tasks
• And let everyone know in the group about
this Leader
• What happens when a leader fails
(crashes)
• Some process detects this (using a Failure
Detector!)
• Then what?
• Focus of this lecture: Election algorithm.
Its goal:
System Model

• N processes.
• Each process has a unique id.
• Messages are eventually delivered.
• Failures may occur during the election protocol.
Calling for an Election

• Any process can call for an election.


• A process can call for at most one
election at a time.
• Multiple processes are allowed to call
an election simultaneously.
• All of them together must yield only a
single leader
• The result of an election should not
depend on which process calls for it.
Election Problem, Formally

• A run of the election algorithm must always


guarantee at the end:
 Safety: For all non-faulty processes p: (p’s elected = (q:
a particular non-faulty process with the best attribute value)
or Null)
 Liveness: For all election runs: (election run terminates) &
for all non-faulty processes p: p’s elected is not Null
• At the end of the election protocol, the non-
faulty process with the best (highest)
election attribute value is elected.
• Common attribute : leader has highest id
• Other attribute examples: leader has highest IP address, or fastest
cpu, or most disk space, or most number of files, etc.

You might also like