Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.

Slides:



Advertisements
Similar presentations
Chapter 5: Tree Constructions
Advertisements

Chapter 13 Leader Election. Breaking the symmetry in system Similar to distributed mutual exclusion problems, the first process to enter the CS can be.
CS 542: Topics in Distributed Systems Diganta Goswami.
1 Deadlock Deadlock is a situation where a process or a set of processes is blocked on an event that never occurs Processes while holding some resources.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Optimal Termination Detection for Rings Murat Demirbas OSU.
Virtual Time “Virtual Time and Global States of Distributed Systems” Friedmann Mattern, 1989 The Model: An asynchronous distributed system = a set of processes.
Lecture 8: Asynchronous Network Algorithms
Uncoordinated Checkpointing The Global State Recording Algorithm.
Token-Dased DMX Algorithms n LeLann’s token ring n Suzuki-Kasami’s broadcast n Raymond’s tree.
Leader Election Let G = (V,E) define the network topology. Each process i has a variable L(i) that defines the leader.  i,j  V  i,j are non-faulty.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Self Stabilization 1.
Lecture 4: Elections, Reset Anish Arora CSE 763 Notes include material from Dr. Jeff Brumfield.
Termination Detection. Goal Study the development of a protocol for termination detection with the help of invariants.
Termination Detection Part 1. Goal Study the development of a protocol for termination detection with the help of invariants.
CS 582 / CMPE 481 Distributed Systems
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Chapter 4 - Self-Stabilizing Algorithms for Model Conservation4-1 Chapter 4: roadmap 4.1 Token Passing: Converting a Central Daemon to read/write 4.2 Data-Link.
CPSC 668Self Stabilization1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.
Chapter 11 Detecting Termination and Deadlocks. Motivation – Diffusing computation Started by a special process, the environment environment sends messages.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Introduction to computer networking Distributed Algorithms Class Recitation.
Election Algorithms and Distributed Processing Section 6.5.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
Distributed Computing 5. Snapshot Shmuel Zaks ©
On Probabilistic Snap-Stabilization Karine Altisen Stéphane Devismes University of Grenoble.
4.5 DISTRIBUTED MUTUAL EXCLUSION MOSES RENTAPALLI.
Centralized mutual exclusion Problem : What if the coordinator fails? Solution : Elect a new one.
Consensus and Its Impossibility in Asynchronous Systems.
Review for Exam 2. Topics included Deadlock detection Resource and communication deadlock Graph algorithms: Routing, spanning tree, MST, leader election.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
Defining Programs, Specifications, fault-tolerance, etc.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
1 ZYZZYVA: SPECULATIVE BYZANTINE FAULT TOLERANCE R.Kotla, L. Alvisi, M. Dahlin, A. Clement and E. Wong U. T. Austin Best Paper Award at SOSP 2007.
Termination Detection
Vector Clock Each process maintains an array of clocks –vc.j.k denotes the knowledge that j has about the clock of k –vc.j.j, thus, denotes the clock of.
“Virtual Time and Global States of Distributed Systems”
1 Leader Election in Rings. 2 A Ring Network Sense of direction left right.
Chapter 7 –System Model – typical assumptions underlying the study of distributed deadlock detection Only reusable resources, only exclusive access, single.
Studying Different Problems from Distributed Computing Several of these problems are motivated by trying to use solutiions used in `centralized computing’
Diffusing Computation. Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple.
Distributed Snapshot. One-dollar bank Let a $1 coin circulate in a network of a million banks. How can someone count the total $ in circulation? If not.
Stabilization Presented by Xiaozhou David Zhu. Contents What-is Motivation 3 Definitions An Example Refinements Reference.
CS 542: Topics in Distributed Systems Self-Stabilization.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
1 Fault tolerance in distributed systems n Motivation n robust and stabilizing algorithms n failure models n robust algorithms u decision problems u impossibility.
1 Chapter 11 Global Properties (Distributed Termination)
CIS 825 Review session. P1: Assume that processes are arranged in a ring topology. Consider the following modification of the Lamport’s mutual exclusion.
Design of Nonmasking Tree Algorithm Goal: design a tree construction protocol systematically by constructing its invariant and fault-span.
Design of Tree Algorithm Objectives –Learning about satisfying safety and liveness of a distributed program –Apply the method of utilizing invariants and.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
CSE 486/586 CSE 486/586 Distributed Systems Leader Election Steve Ko Computer Sciences and Engineering University at Buffalo.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan Transactions are communications with ACID property: Atomicity: all or nothing Consistency:
Distributed Systems Lecture 9 Leader election 1. Previous lecture Middleware RPC and RMI – Marshalling 2.
Revisiting Logical Clocks: Mutual Exclusion Problem statement: Given a set of n processes, and a shared resource, it is required that: –Mutual exclusion.
CIS 825 Lecture 9. Minimum Spanning tree construction Each node is a subtree/fragment by itself. Select the minimum outgoing edge of the fragment Send.
CIS 825 Lecture 8. Leader Election Aim is to elect exactly one node as the leader.
Fundamentals of Fault-Tolerant Distributed Computing In Asynchronous Environments Paper by Felix C. Gartner Graeme Coakley COEN 317 November 23, 2003.
Distributed Systems Lecture 6 Global states and snapshots 1.
“Designing Masking Fault Tolerance via Nonmasking Fault Tolerance“ Oğuzhan YILDIRIM – Erkin GÜVEL Boğaziçi University Computer Engineering Department
Lecture 3: State, Detection
Lecture 9: Asynchronous Network Algorithms
CSE 486/586 Distributed Systems Leader Election
Transactions in Distributed Systems
Distributed Deadlock Detection
Distributed algorithms
CIS825 Lecture 5 1.
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Diffusing Computation

Using Spanning Tree Construction for Solving Leader Election Root is the leader In the presence of faults, –There may be multiple trees Multiple leaders After recovery –There is a unique tree –There is a unique leader

Using Spanning Tree Construction for Solving Leader Election This provides a nonmasking fault-tolerant solution –Eventually, there is one leader –During recovery, The safety specification could be violated because there could be multiple leaders

Designing Masking Fault-Tolerant Solution for Leader Election Need to ensure that there is at most one leader during recovery Can be achieved if a node makes sure that before it declares itself to be the leader, there is no other leader –If this node were to become the true leader, the tree would be reconstructed to be rooted at that node –Check if the tree has been reconstructed I.e., check if all nodes are in the tree rooted at the current node

How? When j changes P.j to j –Check if all nodes have set their root value to j? –Achieved through diffusing computation

Diffusing Computation Initiation –The node that initiates the diffusing computation sends the diffusing computation message to all its children Propagation –A node propagates the diffusing computation when it receives it To propagate, the node sends the diffusion message to all its children A node can check some predicate (condition) during propagation

Diffusing Computation Completion –A node completes the diffusing computation iff All its children complete the diffusing computation All its neighbors have received (propagated) that diffusing computation A node can also check some predicate during completion –The results from this condition are propagated towards the root; The diffusing computation completes when the root completes the diffusing computation –If the condition checked by the root evaluates to true, we say that the diffusing computation completes successfully –Else, we say that the diffusing computation fails/completes unsuccessfully

Using Spanning Tree for Leader Election When a node is about to become leader –It starts a diffusing Computation –If it completes successfully, declare itself to be the leader Goal of the diffusing computation is to check if the tree is formed at the initiator node –In other words, check if root value of all nodes is equal to that of the initiator

Issues –Multiple nodes may start diffusing computation Node with higher ID should win (I.e., its diffusing computation should complete successfully) Node with lower ID should lose. –Failures during diffusing computation Fail the current diffusing computation

Upon completing an unsuccessful diffusing computation –Start another one if the node is still likely to be the leader (P.j = j) –The diffusing computation may have failed due to faults Use sequence number to distinguish between different diffusing computations initiated by the same node

Init P.j = j  Phase.j = prop Sn.j = newseq() Res.j = true –(Result = result of the diffusing computation) –Currently set to true, to be read only after the diffusing computation completes

Propagation Root.j = root.(P.j) /\ sn.j  sn.(P.j)  If (phase.(P.j) = prop) –Phase.j = prop, res.j = true Else –Res.j = false »// Fail this diffusing computation

Completion Phase.j = prop /\  k : k  Neighbors.j : root.j = root.k /\ sn.j = sn.k /\  k : k  Ch.j : phase.j = comp  res.j =  k : k  Neighbors.j  {j} : res.j Phase.j = j If (P.j = j /\  res.j) Init(j) // Initiate a new diffusing computation

Aborting Diffusing Computation Phase.j = comp, res.j = false If (P.j  Neighbors.j) res.(P.j) = false

Combining with Tree Algorithm When j executes tree correction action 1 (red color propagation) –Abort(j) When j executes tree correction action 2 (changing color to green) –Init(j) When j changes tree –Abort(j)

Application in Mutual Exclusion

Diffusing Computation Can be performed in the absence of a tree –Tree is formed during diffusing computation The initiator sends the first diffusion message If node, say j, receives a diffusion from k then –If this is NOT the first diffusion message »Send a reply to k –If this is the first diffusion message then »Send the diffusion to all neighbors »Send a reply to k after replies from ALL neighbors is received »A condition can be checked based on the replies received

Diffusing Computation (continued) The node from which the diffusion message is received for the first time is the parent of that node. –Several problems can be solved by taking appropriate actions during propagation and completion of diffusion Detecting global state Termination detection

Detecting Global State I will introduce the problem. A solution is posted on the web, for reference.

Global State The global state of a system consists of –One local state for each process Contains all the messages sent and received upto a point in computation –Constraints on how the local state can be collected –

Consistency in Global State Consistent iff –If reception of any message is recorded in the global state then the corresponding send is also recorded Note that it is possible that the consistent global state records the send of a message but not receive –It implies that the message is in transit

Examples of (in)Consistent Global States

Revisit Dijkstra Safra Termination Detection Algorithm Note that the token is collecting a global snapshot of the system –Can we see if it is consistent?

2 Phase Termination Detection Maintain c.j similar to Dijkstra-Safra Termination Detection –But no color variable maintained

Application of Global State Detection Termination detection Checkpointing and recovery