Distributed Transaction Management, Fall 2002Lecture 2 / 23.10. Distributed Deadlock Management Jyrki Nummenmaa

Slides:



Advertisements
Similar presentations
Chapter 16 Concurrency. Topics in this Chapter Three Concurrency Problems Locking Deadlock Serializability Isolation Levels Intent Locking Dropping ACID.
Advertisements

1 Concurrency Control Chapter Conflict Serializable Schedules  Two actions are in conflict if  they operate on the same DB item,  they belong.
University of Tampere, CS Department Distributed Transaction Management Jyrki Nummenmaa
Fall 2006R McFadyen ACS Deadlock Prevention Strategies wait-die wound-wait schemes use transaction timestamps for the sake of deadlock prevention.
Concurrency Control.
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture X: Transactions.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
Chapter 3 Deadlocks TOPICS Resource Deadlocks The ostrich algorithm
CompSci 143aSpring, Deadlocks 6.1 Deadlocks with Reusable and Consumable Resources 6.2 Approaches to the Deadlock Problem 6.3 A System Model.
Avishai Wool lecture Introduction to Systems Programming Lecture 5 Deadlocks.
CMPT Dr. Alexandra Fedorova Lecture X: Transactions.
More on transactions…. Dealing with concurrency (OR: how to handle the pressure!) Locking Timestamp ordering Multiversion protocols Optimistic protocols.
Distributed DBMSPage © 1998 M. Tamer Özsu & Patrick Valduriez Outline Introduction Background Distributed DBMS Architecture Distributed Database.
ACS-4902 R. McFadyen 1 Database Concurrency Control Deadlock Deadlock occurs when each transaction in a set is waiting for another transaction in the set.
Transaction Management and Concurrency Control
Transaction Management
©Silberschatz, Korth and Sudarshan16.1Database System Concepts 3 rd Edition Chapter 16: Concurrency Control Lock-Based Protocols Timestamp-Based Protocols.
Chapter 6 Deadlocks Resources Introduction Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Concurrency Control John Ortiz.
Distributed process management: Distributed deadlock
DBMS2001Notes 9: Transaction Processing1 Principles of Database Management Systems 9: More on Transaction Processing Pekka Kilpeläinen (Partially based.
© 1997 UW CSE 11/13/97N-1 Concurrency Control Chapter 18.1, 18.2, 18.5, 18.7.
Deadlocks in Distributed Systems Deadlocks in distributed systems are similar to deadlocks in single processor systems, only worse. –They are harder to.
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.
Distributed DBMSSlide 1Lectured by, Jesmin Akhter, Assistant Professor, IIT, JU PMIT-6102 Advanced Database Systems By- Jesmin Akhter Assistant Professor,
1 Processes, Threads, Race Conditions & Deadlocks Operating Systems Review.
Distributed Txn Management, 2003Lecture 2 / Distributed Transaction Management – 2003 Jyrki Nummenmaa
Chapter 11 Concurrency Control. Lock-Based Protocols  A lock is a mechanism to control concurrent access to a data item  Data items can be locked in.
Concurrency control. Lock-based protocols One way to ensure serializability is to require the data items be accessed in a mutually exclusive manner One.
Chapter 15 Concurrency Control Yonsei University 1 st Semester, 2015 Sanghyun Park.
University of Tampere, CS Department Distributed Transaction Management Jyrki Nummenmaa
Concurrency Control Concurrency Control By Dr.S.Sridhar, Ph.D.(JNUD), RACI(Paris, NICE), RMR(USA), RZFM(Germany) DIRECTOR ARUNAI ENGINEERING COLLEGE TIRUVANNAMALAI.
1 Deadlocks Chapter Resource 3.2. Introduction to deadlocks 3.3. The ostrich algorithm 3.4. Deadlock detection and recovery 3.5. Deadlock avoidance.
1 Deadlocks 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order Suppose.
1 Deadlocks Chapter 3. 2 Resources Examples of computer resources –printers –tape drives –tables Processes need access to resources in reasonable order.
Operating Systems 软件学院 高海昌 Operating Systems Gao Haichang, Software School, Xidian University 22 Contents  1. Introduction** 
Overview of DBMS recovery and concurrency control: Eksemplerne er fra kapitel 3 I bogen: Lars Fank Databaser Teori og Praksis ISBN
II.I Selected Database Issues: 2 - Transaction ManagementSlide 1/20 1 II. Selected Database Issues Part 2: Transaction Management Lecture 4 Lecturer: Chris.
MODERN OPERATING SYSTEMS Third Edition ANDREW S. TANENBAUM Chapter 6 Deadlocks Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All.
Concurrency Control and Reliable Commit Protocol in Distributed Database Systems Jian Jia Chen 2002/05/09 Real-time and Embedded System Lab., CSIE, National.
Concurrency Chapter 6.2 V3.1 Napier University Dr Gordon Russell.
Deadlocks. What is a Deadlock “A set of processes is deadlocked if each process in the set is waiting for an event that only another process in the set.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
Concurrency Control Introduction Lock-Based Protocols
DEADLOCK DETECTION ALGORITHMS IN DISTRIBUTED SYSTEMS
Chapter 7: Deadlock Course Administration n Midterm exam next week in class l Closed book n Final exam time changed to during class.
9 1 Chapter 9_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
10 1 Chapter 10_B Concurrency Control Database Systems: Design, Implementation, and Management, Rob and Coronel.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 15 : Concurrency.
Academic Year 2014 Spring Academic Year 2014 Spring.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
DBMS Deadlock.
Chapter 13 Managing Transactions and Concurrency Database Principles: Fundamentals of Design, Implementation, and Management Tenth Edition.
Synchronization: Distributed Deadlock Detection
Transaction Management and Concurrency Control
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.
ITEC 202 Operating Systems
Concurrency Control.
Multiple Granularity Granularity is the size of data item  allowed to lock. Multiple Granularity is the hierarchically breaking up the database into portions.
Lecture 18: Deadlock: Conditions, Detection and Avoidance (cont.)
Outline Introduction Background Distributed DBMS Architecture
Chapter 15 : Concurrency Control
Concurrency Unit 4.2 Dr Gordon Russell, Napier University
Distributed Database Management Systems
Introduction of Week 13 Return assignment 11-1 and 3-1-5
CONCURRENCY Concurrency is the tendency for different tasks to happen at the same time in a system ( mostly interacting with each other ) .   Parallel.
Concurrency Unit 4.2 Dr Gordon Russell, Napier University
Transactions, Properties of Transactions
Presentation transcript:

Distributed Transaction Management, Fall 2002Lecture 2 / Distributed Deadlock Management Jyrki Nummenmaa

Distributed Transaction Management, Fall 2002Lecture 2 / Deadlock - Introdcution n Example: l P1 locks X on time t1. l P2 locks Y on time t2. l P1 attempts to lock Y and gets blocked. l P2 attemts to X on time t4 and gets blocked.

Distributed Transaction Management, Fall 2002Lecture 2 / Deadlock (continued) n Deadlock can occur in centralised systems. For example: l At the operating system level there can be resource contention between processes l At the transaction processing level there can be data contention between transactions. l In a poorly-designed multithread program, there can be deadlock between threads in the same process.

Distributed Transaction Management, Fall 2002Lecture 2 / Deadlock ”management” approaches n The approach taken by distributed systems designers to the problem of deadlock depends on the frequency with which it occurs. n Tanenbaum lists four possible strategies l Ignore it. l Detection (and recovery). l Prevention (by statically making deadlock structurally impossible) l Avoidance (by allocating resources carefully). l Although Tanenbaum does not mention it, there is actually a fifth strategy in use out there: Detect local deadlock and ignore global deadlock.

Distributed Transaction Management, Fall 2002Lecture 2 / Deadlock n Large database systems are typically multi- user systems; that is, they are systems that allow a large number of txns to access the data in a database at the same time. n In principle, it is possible to at any given time allow only a single txn to execute, but this will not give satisfactory performance. n The txn throughput will be too slow because a txn typically spends most of its lifetime waiting for input/output events to compete as it accesses items of data on disk.

Distributed Transaction Management, Fall 2002Lecture 2 / Local waits-for graphs n Each resource manager can maintain its local `waits- for' graph. n A coordinator maintains a global waits-for graph. When the coordinator detects a deadlock, it selects a victim process and kills it (thereby causing its resource locks to be released), breaking the deadlock. n Problem: The information about changes must be transmitted to the coordinator. The coordinator knows nothing about change information that is in transit. Thus, in practice, many of the deadlocks that it thinks it has detected will be what they call in the trade `phantom deadlocks'.

Distributed Transaction Management, Fall 2002Lecture 2 / Chandy-Misra-Haas algorithm n When a process has to wait for a resource, a probe message is sent to the holding process. n If the holding process is itself blocked, the message is propagated to the blocking processes. n If the message comes back to the sender, then a cycle has been detected.

Distributed Transaction Management, Fall 2002Lecture 2 / Using Waits-For Graphs n In principle, it is possible to detect deadlocks by collecting waits-for graphs from the sites and then combining information from them. n The locking data at one site at some time and at some other time at some other site does not necessarily provide a consistent view about the global situation -> this does not work generally. n Global snapshots can be used to solve this problem.

Distributed Transaction Management, Fall 2002Lecture 2 / Distributed Deadlock Prevention n Some proposed techniques are not feasible in practice, like making a process request all of its resources at the start of execution. n For transaction processing systems with timestamps, the following scheme can be implemented: l When a process blocks, its timestamp is compared to the timestamp of the blocking process. l The blocked process is only allowed to wait if it has a higher timestamp. l This avoids any cyclic dependency.

Distributed Transaction Management, Fall 2002Lecture 2 / Wound-wait and wound-die n In the wound-wait approach, if an older process requests a lock to an item held by a younger process, it wounds the younger process and effectively kills it. n In the wait-die approach, if a younger process requests a lock to an item held by an older process, the younger process commits suicide. n Both of these approaches kill transactions blindly.

Distributed Transaction Management, Fall 2002Lecture 2 / Further considerations for wound-wait and wound-die n To reduce the number of unnecessarily aborted transactions, it is possible to use the cautious waiting rule: ”You are always allowed to wait for a process, which is not waiting for another process.” n The aborted processes are re-started with their original timestamps, to prevent livelock. n In livelock, a transaction does not make progress, as it gets aborted over and over again.