|0. Review and Overview|
1. An Introduction to Distributed Systems
3. Distributed Systems Architecture
6. Distributed OS Theories
|7. Distributed Mutual Exclusions
8. Agreement Protocols
9. Distributed Scheduling
10. Distributed Resource Management
11. Recovery and Fault Tolerance
12. Security and Protection
Life consists not in holding good cards but in playing those you hold well. Josh Billings
System throughput S ( rate at which the system executes requests for the CS )
Sd + E
An algorithm requires that some process acts as a coordinator. The question
is how to select this special process dynamically.
In many systems the coordinator is chosen by hand (e.g. file servers). This
leads to centralized solutions ) single point of failure.
Election by bullying
Each process has an associated priority (weight). The process with
the highest priority should always be elected as the coordinator.
How do we find the heaviest process?
|(a) Pocess 4 holds an election.||(b) Processes 5 and 6 respond, telling 4 to stop.|
|(c) Noew 5 and 6 hold an election.||(d) Process 6 tells 5 to stop.|
|(e) Process 6 wins and tells everyone.|
Suppose crashed nodes comes back on line:
Election in a ring
Process priority is obtained by organizing processes into a (logical)
ring. Process with the highest priority should be elected as
2 and 5 will convert Election messages to COORDINATOR messages.
All processes recognize highest numbered process as new coordinator.
Does it matter if two processes initiate an election?
What happens if a process crashes during the election?
How can we select superpeers such that:
Reserve a fixed part of the ID space for superpeers. Example if S
superpeers are needed for a system that uses m-bit identifiers, simply
reserve the k = |-log2S-| leftmost bits for superpeers. With N nodes,
we'll have, on average, 2k-mN superpeers.
Routing to superpeer
Send message for key p to node responsible for
p AND 11...1100...00
Node Positioning Approach
Election in Wireless Environment
Si -- site, N sites
each site maintains a request set
for each CS invocation
(N-1) REQUEST (N-1) REPLY (N-1) RELEASE total 3(N-1) messages synchronization delay Sd = average delayRicart, Agrawala optimized Lamport's algorithm by merging the RELEASE and REPLY messages.
12 nodes, so majority is 7
Ri ∩ Rj ≠ ∅ all i, j ∈ N
Maekawa found that:
or K = |Ri| ≈ √N
|Failed -- F, Sj cannot grant permission to Sk because Sj has granted permission to a site with higher request priority.|
|Inquire -- I, Sj wants to find out if Sk has successfully locked all sites. ( the outstanding grant to Sk has a lower priority than the new request )|
|Yield -- Y, Sj yields to Sk ( Sj has received a failed message from some other site or Sj has sent a yield to some other site but has not received a new grant )|
13 nodes, 13 = 4(4-1) + 1, thus K = 4
Suppose sites 11, 8, 7 want to enter CS; they all send requests with sequence number 1. ( 7 has highest priority, 8 next, 11 lowest )
11, 7, 8 are circularly locked:
(a) An unordered group of processes on a network.
(b) A logical ring connected in software.
There are three processes, p1, p2, and p3.
p1 and p3 seek mutually exclusive access to a shared resource.
Initially: the token is at p2 and the token's state is LN = [0, 0, 0] and Q empty;
p1's state is: n1 ( seq # ) = 0, RN1 = [0, 0, 0];
p2's state is: n2 = 0, RN2 = [0, 0, 0];
p3's state is: n3 = 0, RN3 = [0, 0, 0];
Comparison of Lamport and Suzuki-Kazami Algorithms
The essential difference is in who keeps the queue. In one case every site keeps its own local copy of the queue. In the other case, the queue is passed around within the token.