Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state.

Slides:



Advertisements
Similar presentations
Global States and Checkpoints
Advertisements

Last Class: Clock Synchronization
CS 542: Topics in Distributed Systems Diganta Goswami.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
Lecture 8: Asynchronous Network Algorithms
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Reliable Multicast Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
1 CS 194: Elections, Exclusion and Transactions Scott Shenker and Ion Stoica Computer Science Division Department of Electrical Engineering and Computer.
Uncoordinated Checkpointing The Global State Recording Algorithm Cristian Solano.
Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Distributed Systems Spring 2009
LEADER ELECTION CS Election Algorithms Many distributed algorithms need one process to act as coordinator – Doesn’t matter which process does the.
4. Synchronization Clock synchronization
CS 582 / CMPE 481 Distributed Systems
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Distributed Snapshots –Termination detection Election algorithms –Bully –Ring.
CS603 Process Synchronization February 11, Synchronization: Basics Problem: Shared Resources –Generally data –But could be others Approaches: –Model.
Synchronization Chapter 5.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
EEC-681/781 Distributed Computing Systems Lecture 11 Wenbing Zhao Cleveland State University.
Clock Synchronization and algorithm
Synchronization Chapter 5. Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms.
Election Algorithms and Distributed Processing Section 6.5.
Election Algorithms. Topics r Issues r Detecting Failures r Bully algorithm r Ring algorithm.
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.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved Chapter 6 Synchronization.
Mutual exclusion Concurrent access of processes to a shared resource or data is executed in mutually exclusive manner Distributed mutual exclusion can.
Lecture 5: Sun: 1/5/ Distributed Algorithms - Distributed Databases Lecturer/ Kawther Abas CS- 492 : Distributed system &
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
Computer Science Lecture 12, page 1 CS677: Distributed OS Last Class Vector timestamps Global state –Distributed Snapshot Election algorithms –Bully algorithm.
Coordination and Agreement. Topics Distributed Mutual Exclusion Leader Election.
Synchronization CSCI 4900/6900. Importance of Clocks & Synchronization Avoiding simultaneous access of resources –Cooperate to grant exclusive access.
DC6: Chapter 12 Coordination Election Algorithms Distributed Mutual Exclusion Consensus Group Communication.
CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 8 Leader Election Section 12.3 Klara Nahrstedt.
Synchronization CSCI 4780/6780. Mutual Exclusion Concurrency and collaboration are fundamental to distributed systems Simultaneous access to resources.
Synchronization Chapter 5. Outline 1.Clock synchronization 2.Logical clocks 3.Global state 4.Election algorithms 5.Mutual exclusion 6.Distributed transactions.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
Real-Time & MultiMedia Lab Synchronization Distributed System Jin-Seung,KIM.
CLOCK SYNCHRONIZATION SUSMITHA KOTA 21- SEP-2015.
Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.
Election Distributed Systems. Algorithms to Find Global States Why? To check a particular property exist or not in distributed system –(Distributed) garbage.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Page 1 Mutual Exclusion & Election Algorithms Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content.
Synchronization. Clock Synchronization In a centralized system time is unambiguous. In a distributed system agreement on time is not obvious. When each.
CSE 486/586 CSE 486/586 Distributed Systems Global States Steve Ko Computer Sciences and Engineering University at Buffalo.
1 Chapter 11 Global Properties (Distributed Termination)
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
Synchronization Chapter 5. Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned.
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.
Lecture on Synchronization Submitted by
CIS 825 Lecture 8. Leader Election Aim is to elect exactly one node as the leader.
Lecture 11: Coordination and Agreement Central server for mutual exclusion Election – getting a number of processes to agree which is “in charge” CDK4:
Advanced Topics in Concurrency and Reactive Programming: Time and State Majeed Kassis.
Distributed Processing Election Algorithm
Lecture 17: Leader Election
CSE 486/586 Distributed Systems Global States
Lecture 9: Asynchronous Network Algorithms
EECS 498 Introduction to Distributed Systems Fall 2017
Lecture 10: Coordination and Agreement
Chapter 5 (through section 5.4)
Prof. Leonardo Mostarda University of Camerino
Lecture 11: Coordination and Agreement
CSE 486/586 Distributed Systems Global States
CIS825 Lecture 5 1.
CSE 486/586 Distributed Systems Leader Election
Presentation transcript:

Computer Science Lecture 11, page 1 CS677: Distributed OS Last Class: Clock Synchronization Logical clocks Vector clocks Global state

Computer Science Lecture 11, page 2 CS677: Distributed OS Today: More Canonical Problems Distributed snapshot and termination detection Election algorithms –Bully algorithm –Ring algorithm

Computer Science Lecture 11, page 3 CS677: Distributed OS Global State Global state of a distributed system –Local state of each process –Messages sent but not received (state of the queues) Many applications need to know the state of the system –Failure recovery, distributed deadlock detection Problem: how can you figure out the state of a distributed system? –Each process is independent –No global clock or synchronization Distributed snapshot: a consistent global state

Computer Science Lecture 11, page 4 CS677: Distributed OS Distributed Snapshot Algorithm Assume each process communicates with another process using unidirectional point-to-point channels (e.g, TCP connections) Any process can initiate the algorithm –Checkpoint local state –Send marker on every outgoing channel On receiving a marker –Checkpoint state if first marker and send marker on outgoing channels, save messages on all other channels until: –Subsequent marker on a channel: stop saving state for that channel

Computer Science Lecture 11, page 5 CS677: Distributed OS Distributed Snapshot A process finishes when –It receives a marker on each incoming channel and processes them all –State: local state plus state of all channels –Send state to initiator Any process can initiate snapshot –Multiple snapshots may be in progress Each is separate, and each is distinguished by tagging the marker with the initiator ID (and sequence number) A C B M M

Computer Science Lecture 11, page 6 CS677: Distributed OS Snapshot Algorithm Example a)Organization of a process and channels for a distributed snapshot

Computer Science Lecture 11, page 7 CS677: Distributed OS Snapshot Algorithm Example b)Process Q receives a marker for the first time and records its local state c)Q records all incoming message d)Q receives a marker for its incoming channel and finishes recording the state of the incoming channel

Computer Science Lecture 11, page 8 CS677: Distributed OS Termination Detection Detecting the end of a distributed computation Notation: let sender be predecessor, receiver be successor Two types of markers: Done and Continue After finishing its part of the snapshot, process Q sends a Done or a Continue to its predecessor Send a Done only when –All of Q’s successors send a Done –Q has not received any message since it check-pointed its local state and received a marker on all incoming channels –Else send a Continue Computation has terminated if the initiator receives Done messages from everyone

Computer Science Lecture 11, page 9 CS677: Distributed OS Election Algorithms Many distributed algorithms need one process to act as coordinator –Doesn’t matter which process does the job, just need to pick one Election algorithms: technique to pick a unique coordinator (aka leader election) Examples: take over the role of a failed process, pick a master in Berkeley clock synchronization algorithm Types of election algorithms: Bully and Ring algorithms

Computer Science Lecture 11, page 10 CS677: Distributed OS Bully Algorithm Each process has a unique numerical ID Processes know the Ids and address of every other process Communication is assumed reliable Key Idea: select process with highest ID Process initiates election if it just recovered from failure or if coordinator failed 3 message types: election, OK, I won Several processes can initiate an election simultaneously –Need consistent result O(n 2 ) messages required with n processes

Computer Science Lecture 11, page 11 CS677: Distributed OS Bully Algorithm Details Any process P can initiate an election P sends Election messages to all process with higher Ids and awaits OK messages If no OK messages, P becomes coordinator and sends I won messages to all process with lower Ids If it receives an OK, it drops out and waits for an I won If a process receives an Election msg, it returns an OK and starts an election If a process receives a I won, it treats sender an coordinator

Computer Science Lecture 11, page 12 CS677: Distributed OS Bully Algorithm Example The bully election algorithm Process 4 holds an election Process 5 and 6 respond, telling 4 to stop Now 5 and 6 each hold an election

Computer Science Lecture 11, page 13 CS677: Distributed OS Bully Algorithm Example d)Process 6 tells 5 to stop e)Process 6 wins and tells everyone

Computer Science Lecture 11, page 14 CS677: Distributed OS Ring-based Election Processes have unique Ids and arranged in a logical ring Each process knows its neighbors –Select process with highest ID Begin election if just recovered or coordinator has failed Send Election to closest downstream node that is alive –Sequentially poll each successor until a live node is found Each process tags its ID on the message Initiator picks node with highest ID and sends a coordinator message Multiple elections can be in progress –Wastes network bandwidth but does no harm

Computer Science Lecture 11, page 15 CS677: Distributed OS A Ring Algorithm Election algorithm using a ring.

Computer Science Lecture 11, page 16 CS677: Distributed OS Comparison Assume n processes and one election in progress Bully algorithm –Worst case: initiator is node with lowest ID Triggers n-2 elections at higher ranked nodes: O(n 2 ) msgs –Best case: immediate election: n-2 messages Ring –2 (n-1) messages always