Distributed Deadlocks

Slides:



Advertisements
Similar presentations
Chapter 7: Deadlocks.
Advertisements

Chapter 7: Deadlocks Adapted by Donghui Zhang from the original version by Silberschatz et al.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Distributed Mutual Exclusion.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Distributed Scheduling.
Washington WASHINGTON UNIVERSITY IN ST LOUIS Concurrency: Deadlock Detection Fred Kuhns Department.
1 Thursday, June 29, 2006 "If you really think there's a bug you should report a bug. Maybe you're not using it properly. Have you ever considered that?"
Global States.
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
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.
1 Distributed Deadlock Fall DS Deadlock Topics Prevention –Too expensive in time and network traffic in a distributed system Avoidance.
Handling Deadlocks n definition, wait-for graphs n fundamental causes of deadlocks n resource allocation graphs and conditions for deadlock existence n.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Basics of Deadlock Theory.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed System Architectures.
Deadlocks in Distributed Systems Ryan Clemens, Thomas Levy, Daniel Salloum, Tagore Kolluru, Mike DeMauro.
Distributed Transaction Management, Fall 2002Lecture 2 / Distributed Deadlock Management Jyrki Nummenmaa
What we will cover…  Distributed Coordination 1-1.
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
Chapter 11 Detecting Termination and Deadlocks. Motivation – Diffusing computation Started by a special process, the environment environment sends messages.
Distributed process management: Distributed deadlock
What we will cover…  The Deadlock Problem  System Model  Deadlock Characterization  Methods for Handling Deadlocks  Deadlock Prevention  Deadlock.
Distributed Systems Fall 2009 Distributed transactions.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Logical Clocks and Global State.
Deadlocks in Distributed Systems Deadlocks in distributed systems are similar to deadlocks in single processor systems, only worse. –They are harder to.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Distributed Mutual Exclusion.
Distributed Deadlocks and Transaction Recovery.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
Deadlocks – An Introduction
4.5 DISTRIBUTED MUTUAL EXCLUSION MOSES RENTAPALLI.
System Model Deadlock Characterization Methods for Handling Deadlocks Deadlock Prevention, Avoidance, and Detection Recovering from Deadlock Combined Approach.
PAVANI REDDY KATHURI TRANSACTION COMMUNICATION. OUTLINE 0 P ART I : I NTRODUCTION 0 P ART II : C URRENT R ESEARCH 0 P ART III : F UTURE P OTENTIAL 0 R.
Presenter: Long Ma Advisor: Dr. Zhang 4.5 DISTRIBUTED MUTUAL EXCLUSION.
Cosc 4740 Chapter 6, Part 4 Deadlocks. The Deadlock Problem A set of blocked processes each holding a resource and waiting to acquire a resource held.
CHAPTER 8: DEADLOCKS System Model Deadlock Characterization
Chapter 7 –System Model – typical assumptions underlying the study of distributed deadlock detection Only reusable resources, only exclusive access, single.
Distributed and hierarchical deadlock detection, deadlock resolution
Dr. Kalpakis CMSC 421, Operating Systems Deadlocks.
DEADLOCK DETECTION ALGORITHMS IN DISTRIBUTED SYSTEMS
Chapter pages1 Distributed Process Management Chapter 14.
By Purva Gawde For Advanced Operating Systems Instructor: Mikhail Nesterenko.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
CSC 8420 Advanced Operating Systems Georgia State University Yi Pan Transactions are communications with ACID property: Atomicity: all or nothing Consistency:
Parallel and Distributed Simulation Deadlock Detection & Recovery.
Distributed Systems Lecture 6 Global states and snapshots 1.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Chapter 7: Deadlocks.
OPERATING SYSTEM CONCEPTS AND PRACTISE
Process Management Deadlocks.
Chapter 7: Deadlocks.
Synchronization: Distributed Deadlock Detection
Mutual Exclusion A condition in which there is a set of processes, only one of which is able to access a given resource or perform a given function at.
Chapter 18 Distributed Control Algorithms
The Echo Algorithm The echo algorithm can be used to collect and disperse information in a distributed system It was originally designed for learning network.
Chapter 7: Deadlocks.
Operating System: DEADLOCKS
Outline Distributed Mutual Exclusion Distributed Deadlock Detection
Distributed Mutual Exclusion
Distributed Deadlock Detection
Distributed Deadlock Fall 2001.
Ho-Ramammorthy 2 phase snapshot algorithm PRESENTATION
Chapter 7: Deadlocks.
Outline Deadlocks, dead lock prevention, avoidance.
Deadlock Prevention Restrain the ways request can be made.
Deadlocks Session - 14.
Deadlock B.Ramamurthy CSE421 2/23/2019 B.Ramamurthy.
UNIVERSITAS GUNADARMA
Distributed Deadlock Detection
Chapter 7: Deadlocks.
Presentation transcript:

Distributed Deadlocks

Model resource vs communication deadlocks wait-for-graph (WFG; TWG in database parla) strategies: prevention, avoidance, detection & resolution issues in detection & resolution all existing deadlocks must be detected in finite time no false (phantom) deadlocks should be detected selecting victims and cleaning up WFG after resolution fundamental causes of difficulty: consistent global state and lack of global clocks deadlock detection algorithms centralized, distributed, hierarchical

Completely Centralized Deadlock Detection Algorithm every process sends its request/release resource requests to a central control site which performs deadlock detection and resolution advantages simple and easy to implement disadvantages inefficient (requests for local resources are sent to control site) large communication delays congestion fault-tolerance phantom deadlocks

Ho-Ramamoorthy’s One-Phase Centralized deadlock Detection Algorithm a control site periodically requests a status report from all sites each site maintains resource status table which lists for each resource the processes that hold/request local resources process status table which keeps track of resources held/requested by all local processes WFG is constructed by adding a request/assignment edge between P and R if only if P and R appear consistently in both the relevant process status and resource status tables cons: storage and larger messages Ho-Ramamoorthy’s two-phase algorithm, which only uses process status tables, detects phantom deadlocks

Distributed Deadlock Detection Algorithms Various strategies for constructing global WFG path-pushing which disseminate wait-for dependencies in the form of paths (e.g. Obermarck’s algorithm) edge-chasing which circulate a “probe” to detect a cycle (e.g. Chandy-Misra-Haas’s algorithm) diffusion computation which use “echo messages” (i.e. query/reply messages) global state based which are based on the fact that deadlock is a persistent (stable) system property

Obermack’s Deadlock Detection Algorithm A path-pushing algorithm Transactions consist of a number of subtransactions and at each point in time only one subtransaction is active transactions are totally ordered special node “External” (Ex) abstracts remote sites in the WFG upon receiving deadlock detection information, a site constructs received info with its local WFG detects and resolves all local deadlocks (which do not contain node Ex) for all cycles (Ex, T1, T2, …, Tk, Ex) it sends this path to all other sites where a subtransaction of T1, T2, .., Tk may be waiting to receive a message from a local subtransaction (and remote subtransaction at that site has higher priority than local subtransaction)

Obermack’s Deadlock Detection Algorithm Detects phantom deadlocks (cased by the asynchronous snapshots taken by the various sites) performance #messages is n(n-1)/2 for a deadlock involving n sites message size is O(n) detection delay is O(n)

Chandy-Misra-Haas’s Edge-Chasing Deadlock Detection Algorithm Uses a probe message (i,j, k): deadlock detection initiated for process Pi and is sent by the site of Pj to the site of Pk boolean vector dependent(i,j) is kept at the site of Pi, which is true only if Pi knows that Pj is dependent on Pi

Chandy-Misra-Haas’s Edge-Chasing Algorithm Deadlock initiation at Pi if Pi is locally dependent on itself, then “deadlock” else for all Pj and Pk send a probe (i, j, k) to the site of Pk if Pi is locally dependent on Pj Pj is waiting for Pk Pk runs on another site

Chandy-Misra-Haas’s Edge-Chasing Algorithm Upon receipt of a probe (i,j,k) at the site of Pk if Pk is blocked, and dependent(k,i) is false, and Pk has not replied to all the requests of Pj, then set dependent(k,i) = true if k=i then “deadlock” else send a probe (i, m, n) to the site of Pn, if Pk is dependent on Pm, Pm waits for Pn, and Pm and Pn are on different sites

Chandy-Misra-Haas’s Edge-Chasing Algorithm Performance #messages is m(n-1)/2, where m is #processes and n is #sites involved in the deadlock message size is very small detection delay is O(n)

Chandy-Misra-Haas’s Diffusion Deadlock Detection Algorithm Deadlock detection computation is diffused through the WFG uses two types of messages: query(i,j,k) and reply(i,j,k) processes are active or blocked a blocked process Pi sends query messages to its dependent set DSi of processes engaging query: 1st query(i,j,k) message received by Pk num(k,i) is #query messages sent by Pk for deadlock initiated by Pi wait(k,i) is true if Pk was continuously blocked since the receipt of engaging query by Pi Pi detects a deadlock is it receives replies to all query messages it sent

Chandy-Misra-Haas’s Diffusion Algorithm Initiate deadlock detection at Pi send query(i,i,j) to all prtocesses Pj in Dsi set num(i,i) = sizeof(DSi) set wait(i,i) to true Upon receipt of query(i,j,k) at Pk if not engaging query and wait(k,i) then send reply(i,k,j) to Pj else if engaging query then send query(i,k,m) to all Pm in DSk set num(k,i) = sizeof(DSk) set wait(k,i) to true set engage(k,i) = j

Chandy-Misra-Haas’s Diffusion Algorithm Upon receipt of reply(i,j,k) at Pk if wait(k,i) then decrement num(k,i) by 1 if num(k,i) = 0 then if I=k then ‘deadlock” else send reply(i,k,m) to Pm where m = engage(k,i) Note that only one diffusion computation can be active at a time multiple diffusion computations may be active clocks can be used to distinguise old/new diffusion computations for each process

Hierarchical Deadlock Detection Algorithms Menasce-Muntz controllers are organized in a tree leaf controllers manage resources other controllers detect deadlocks each controller maintains a WFG for its subtree each controller updates (continuously or periodically) its parent whenever there is a change in its WFG Ho-Ramamoorthy partition sites into clusters, each having a control site designate a central control site control sites run Ho-Ramamoorthy’s one-phase algorithm central control splices cluster-WFG to global WFG

Performance Metrics Trade-off between storage overhead Communication overhead deadlock persistence time storage overhead computation overhead resolution overhead how process behavior and detection/resolution algorithm used affect these measures is open

Deadlock Resolution Efficient resolution of deadlock requires knowledge of all processes and resources involved in the deadlock in many algorithms process detecting the deadlock does not know all processes/resources involved in the deadlock more than one processes may detect the same deadlock use of process priorities can help to address these issues resolving a deadlock requires that victim is aborted and resources restored to a proper state detection info for victim flushed out from the system quickly since otherwise phantom deadlocks may be detected aborting a single victim may resolve all deadlocks detection and resolution interact extensively