Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
1 views

Module 4 Distributed System

The document discusses failure assumptions and failure detectors in distributed systems, highlighting the challenges of process crashes and the role of failure detectors in identifying failures. It also covers algorithms for distributed mutual exclusion and election processes, including Maekawa's voting algorithm, the ring-based election algorithm, and the bully algorithm. Additionally, it describes a system model for group communication where processes communicate reliably through multicast operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Module 4 Distributed System

The document discusses failure assumptions and failure detectors in distributed systems, highlighting the challenges of process crashes and the role of failure detectors in identifying failures. It also covers algorithms for distributed mutual exclusion and election processes, including Maekawa's voting algorithm, the ring-based election algorithm, and the bully algorithm. Additionally, it describes a system model for group communication where processes communicate reliably through multicast operations.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

Module-4

Coordination and agreement

Department of
Computer Science & Engineering

www.cambridge.edu.in
Failure assumptions and failure detectors

CiTech, BANGALORE
Failure assumptions and failure detectors

Over a point-to-point network such as the Internet, complex


topologies and independent routing choices mean that
connectivity may be
• Asymmetric connectivity: communication is possible from
process p to process q, but not vice versa.

• Intransitive connectivity: communication is possible from p to q


and from q to r, but p cannot communicate directly with r.

CiTech, BANGALORE
Failure assumptions and failure detectors
• One of the problems in the design of algorithms that can
overcome process crashes is that of deciding when a process
has crashed.
• A failure detector is a service that processes queries about
whether a particular process has failed.
• It is often implemented by an object local to each process (on
the same computer) that runs a failure-detection algorithm in
conjunction with its counterparts at other processes.
• The object local to each process is called a local failure
detector.
Failure assumptions and failure detectors
• An unreliable failure detector may produce one of two values
when given the identity of a process:
✓ A result of Unsuspected signifies that the detector has
recently received evidence suggesting that the process has
not failed;
✓ A result of Suspected signifies that the failure detector has
some indication that the process may have failed.

CiTech, BANGALORE
Failure assumptions and failure detectors
• A reliable failure detector is one that is always accurate in
detecting a process’s failure.

CiTech, BANGALORE
Distributed Mutual Exclusion
• If a collection of processes share a resource or collection of
resources, then often mutual exclusion is required to prevent
interference and ensure consistency when accessing the
resources.

CiTech, BANGALORE
Algorithms for mutual exclusion

CiTech, BANGALORE
The central server algorithm

CiTech, BANGALORE
A ring-based algorithm

CiTech, BANGALORE
CiTech, BANGALORE
An algorithm using multicast and logical
clocks

CiTech, BANGALORE
Maekawa’s voting algorithm
• Maekawa observed that in order for a process to enter a critical
section, it is not necessary for all of its peers to grant it access.

• Processes need only obtain permission to enter from subsets of


their peers, as long as the subsets used by any two processes
overlap.

• A ‘candidate’ process must collect sufficient votes to enter.

• Processes in the intersection of two sets of voters ensure the


safety property ME1, that at most one process can enter the
critical section, by casting their votes for only one candidate.
CiTech, BANGALORE
Maekawa’s voting algorithm

CiTech, BANGALORE
Maekawa’s voting algorithm

CiTech, BANGALORE
Maekawa’s voting algorithm

CiTech, BANGALORE
Election
• An algorithm for choosing a unique process to play a particular role
is called an election algorithm.
• A process calls the election if it takes an action that initiates a
particular run of the election algorithm.
• An individual process does not call more than one election at a
time, but in principle the N processes could call N concurrent
elections.
• At any point in time, a process pi is either a participant – meaning
that it is engaged in some run of the election algorithm – or
• a non-participant – meaning that it is not currently engaged in any
election.
CiTech, BANGALORE
Ring-based election algorithm
• The algorithm of Chang and Roberts [1979] is suitable for a
collection of processes arranged in a logical ring.
• Each process pi has a communication channel to the next process
in the ring, and all messages are sent clockwise around the ring.
• We assume that no failures occur, and that the system is
asynchronous.
• The goal of this algorithm is to elect a single process called the
coordinator, which is the process with the largest identifier.

CiTech, BANGALORE
Ring-based election algorithm

• Initially, every process is marked as a non-participant in an election.


• Any process can begin an election. It proceeds by marking itself as a
participant, placing its identifier in an election message and sending it
to its clockwise neighbor.

CiTech, BANGALORE
Ring-based election algorithm
• When a process receives an election message, it compares the
identifier in the message with its own.
❖ If the arrived identifier is greater, then it forwards the message to
its neighbor.
❖ If the arrived identifier is smaller and the receiver is not a
participant, then it substitutes its own identifier in the message
and forwards it; but it does not forward the message if it is already
a participant.

CiTech, BANGALORE
Ring-based election algorithm
• On forwarding an election message in any case, the process marks
itself as a participant.
• If, the received identifier is that of the receiver itself, then this
process’s identifier must be the greatest, and it becomes the
coordinator.
• The coordinator marks itself as a non-participant once more and
sends an elected message to its neighbor, announcing its election
and enclosing its identity.

CiTech, BANGALORE
CiTech, BANGALORE
The bully algorithm

• The bully algorithm [Garcia-Molina 1982] allows processes to crash


during an election, although it assumes that message delivery
between processes is reliable.
• Unlike the ring-based algorithm, this algorithm assumes that the
system is synchronous: it uses timeouts to detect a process failure.
• Another difference is that the ring-based algorithm assumed that
processes have minimal a priori knowledge of one another: each
knows only how to communicate with its neighbor, and none knows
the identifiers of the other processes.

CiTech, BANGALORE
The bully algorithm

• There are three types of message in this algorithm:


• an election message is sent to announce an election
• an answer message is sent in response to an election message
• a coordinator message is sent to announce the identity of the
elected process– the new ‘coordinator’.

CiTech, BANGALORE
The bully algorithm
• The process that knows it has the highest identifier can elect itself
as the coordinator simply by sending a coordinator message to all
processes with lower identifiers.
• a process with a lower identifier can begin an election by sending
an election message to those processes that have a higher identifier
and awaiting answer messages in response.
• If none arrives within time T, the process considers itself the
coordinator and sends a coordinator message to all processes with
lower identifiers announcing this.
• Otherwise, the process waits a further period Tc for a coordinator
message to arrive from the new coordinator. If none arrives, it
begins another election.
The bully algorithm

• If a process pi receives a coordinator message, it sets its variable


electedi to the identifier of the coordinator contained within it and
treats that process as the coordinator.
• If a process receives an election message, it sends back an answer
message and begins another election – unless it has begun one
already.
The bully algorithm
• When a process is started to replace a crashed process, it begins an
election.
• If it has the highest process identifier, then it will decide that it is
the coordinator and announce this to the other processes. Thus it
will become the coordinator, even though the current coordinator is
functioning.
• It is for this reason that the algorithm is called the ‘bully’ algorithm.
CiTech, BANGALORE
Coordination and Agreement in group
communication
System model:
• The system under consideration contains a collection of processes,
which can communicate reliably over one-to-one channels.
• As before, processes may fail only by crashing.
• The processes are members of groups, which are the destinations
of messages sent with the multicast operation.
• The operation multicast(g, m) sends the message m to all members
of the group g of processes.
• Correspondingly, there is an operation deliver(m) that delivers a
message sent by multicast to the calling process.

CiTech, BANGALORE

You might also like