Distributed Transactions

Slides:



Advertisements
Similar presentations
Database Systems (資料庫系統)
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
Slides for Chapter 13: Distributed transactions
Lecture 11 Recoverability. 2 Serializability identifies schedules that maintain database consistency, assuming no transaction fails. Could also examine.
COS 461 Fall 1997 Transaction Processing u normal systems lose their state when they crash u many applications need better behavior u today’s topic: how.
Database Systems, 8 th Edition Concurrency Control with Time Stamping Methods Assigns global unique time stamp to each transaction Produces explicit.
Exercises for Chapter 17: Distributed Transactions
CIS 720 Concurrency Control. Timestamp-based concurrency control Assign a timestamp ts(T) to each transaction T. Each data item x has two timestamps:
1 TRANSACTION & CONCURRENCY CONTROL Huỳnh Văn Quốc Phương Thái Thị Thu Thủy
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
Data and Database Administration Chapter 12. Outline What is Concurrency Control? Background Serializability  Locking mechanisms.
ICS 421 Spring 2010 Distributed Transactions Asst. Prof. Lipyeow Lim Information & Computer Science Department University of Hawaii at Manoa 3/16/20101Lipyeow.
Distributed Systems 2006 Styles of Client/Server Computing.
Distributed Systems Fall 2010 Transactions and concurrency control.
CS 582 / CMPE 481 Distributed Systems Concurrency Control.
Transaction Management and Concurrency Control
Persistent State Service 1 Distributed Object Transactions  Transaction principles  Concurrency control  The two-phase commit protocol  Services for.
Transaction Management
Chapter 18: Distributed Coordination (Chapter 18.1 – 18.5)
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 11: Transactions Dr. Michael R. Lyu Computer Science & Engineering.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
CMPT 401 Summer 2007 Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
Distributed Systems Fall 2009 Distributed transactions.
CMPT Dr. Alexandra Fedorova Lecture XI: Distributed Transactions.
Transactions and concurrency control
TRANSACTIONS AND CONCURRENCY CONTROL Sadhna Kumari.
Distributed Deadlocks and Transaction Recovery.
CS162 Section Lecture 10 Slides based from Lecture and
Distributed Transactions March 15, Transactions What is a Distributed Transaction?  A transaction that involves more than one server  Network.
DISTRIBUTED SYSTEMS II AGREEMENT (2-3 PHASE COM.) Prof Philippas Tsigas Distributed Computing and Systems Research Group.
Distributed Transactions: Distributed deadlocks Recovery techniques.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Transaction Communications Yi Sun. Outline Transaction ACID Property Distributed transaction Two phase commit protocol Nested transaction.
Lecture 12: Distributed transactions Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
Distributed Transactions CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Nikita Borisov - UIUC Material derived from slides by I. Gupta, M. Harandi,
Operating Systems Distributed Coordination. Topics –Event Ordering –Mutual Exclusion –Atomicity –Concurrency Control Topics –Event Ordering –Mutual Exclusion.
Transactions and Concurrency Control Distribuerade Informationssystem, 1DT060, HT 2013 Adapted from, Copyright, Frederik Hermans.
Distributed Transaction Management, Fall 2002Lecture Distributed Commit Protocols Jyrki Nummenmaa
 Distributed file systems having transaction facility need to support distributed transaction service.  A distributed transaction service is an extension.
Distributed Transactions Chapter – Vidya Satyanarayanan.
Transactions and Concurrency Control. Concurrent Accesses to an Object Multiple threads Atomic operations Thread communication Fairness.
Page 1 Concurrency Control Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Transaction Management Overview. Transactions Concurrent execution of user programs is essential for good DBMS performance. – Because disk accesses are.
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Slides for Chapter 17: Distributed.
 2002 M. T. Harandi and J. Hou (modified: I. Gupta) Distributed Transactions.
IM NTU Distributed Information Systems 2004 Distributed Transactions -- 1 Distributed Transactions Yih-Kuen Tsay Dept. of Information Management National.
Introduction to Distributed Databases Yiwei Wu. Introduction A distributed database is a database in which portions of the database are stored on multiple.
A client transaction becomes distributed if it invokes operations in several different Servers There are two different ways that distributed transactions.
Multidatabase Transaction Management COP5711. Multidatabase Transaction Management Outline Review - Transaction Processing Multidatabase Transaction Management.
10-Jun-16COMP28112 Lecture 131 Distributed Transactions.
Atomic Tranactions. Sunmeet Sethi. Index  Meaning of Atomic transaction.  Transaction model Types of storage. Transaction primitives. Properties of.
Distributed Databases – Advanced Concepts Chapter 25 in Textbook.
Recovery in Distributed Systems:
Two phase commit.
Slides for Chapter 14: Distributed transactions
Introduction of Week 13 Return assignment 11-1 and 3-1-5
Distributed Transactions
Atomic Commit and Concurrency Control
Distributed Transactions
Exercises for Chapter 14: Distributed Transactions
Distributed Transactions
UNIVERSITAS GUNADARMA
Transactions in Distributed Systems
Distributed Transactions
Distributed Systems Course Distributed transactions
Distributed Transactions
TRANSACTION & CONCURRENCY CONTROL
CIS 720 Concurrency Control.
Presentation transcript:

Distributed Transactions

Structures of Distributed Transactions Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

A Nested Banking Transaction Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

A Distributed Banking Transaction Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Atomic Commitment When a distributed (flat) transaction comes to an end, either all or none of its operations are carried out. Due to atomicity, if one part of a transaction is aborted, then the whole transaction must also be aborted.

The Two-Phase Commit Protocol The two-phase commit protocol is designed to allow any server to abort its part of a transaction. In the first phase, each server votes for the transaction to be committed or aborted. In the second phase, every server carries out the joint decision.

Operations in the Two-Phase Commit Protocol Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

The Two-Phase Commit Protocol Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

The Two-Phase Commit Protocol (cont’d) Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Operations for Coordinating Distributed Transactions Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Atomic Commitment in Nested Transactions When a subtransaction completes, it makes an independent decision either to commit provisionally or to abort. A parent transaction may commit even if one of its child transactions has aborted. Subtransactions will not carry out a real commitment unless the entire nested transaction descides to commit.

Atomic Commitment in Nested Transactions (cont’d) When a nested transaction provisionally commits, it reports its status and the status of its descendants to its parent. When a nested transaction aborts, it just reports abort to its parent. Eventually, the top-level transaction receives a list of all the subtransactions (except the descendants of an aborted transaction) in the tree, together with the status of each.

Deciding Whether to Commit Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Two-Phase Commit in Nest Transactions When a server receives a CanCommit?... If it has provisionally committed substractions, then it * prepares those without aborted ancestors for commitment, * aborts those with aborted ancestors, and * sends a Yes vote to the coordinator; Otherwise (it must have failed), it sends a No vote.

Information for a Nested Transaction Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Locking Each server maintains locks for its own data items. Locks cannot be released until the transaction has been committed or aborted at all servers. Distributed deadlocks might occur if different servers impose different orderings on transactions.

Locking (cont’d) Parent transactions are not allowed to run concurrently with their child transactions. To acquire a read lock, all holders of write lock on the data item must be ancestors. To acquire a write lock, all holders of read and write locks on the data item must be ancestors. When a nested transaction commits, its locks are inherited by its parent; when a nested transaction aborts, its locks are removed.

Timestamp Ordering A globally unique transaction timestamp is issued by the coordinator. Conflicts are resolved as each operation is performed. If the resolution of a conflict requires a transaction to be aborted, the coordinator will be informed.

Optimistic Concurrency Control If only one transaction may perform validation at the same time, commitment deadlocks might occur; parallel validation does not have the problem. A parallel validation checks (among other things) conflicts between write operations of the transaction being validated against the write operations of other concurrent transactions.

Optimistic Concurrency Control (cont’d) To ensure that transactions at different servers are globally serializable, the servers may * conduct a global validation (checking if there is a cyclic ordering) or * use the same globally unique transaction number for the same transaction.

An Interleaving of Three Transactions Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Distributed Deadlocks A cycle in the global wait-for graph (but not in any single local one) represents a distributed deadlock. A deadlock that is detected but is not really a deadlock is called a phantom deadlock. Two-phase locking prevents phantom deadlocks; autonomous aborts may cause phantom deadlocks.

Distributed Deadlocks and Wait-For Graphs Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Local and Global Wait-For Graphs Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Edge Chasing Initiation: when a server notes that a transaction T starts waiting for another transaction U, which is waiting to access a data item at another server, it sends a probe containing TU to the server of the data item at which transaction U is blocked.

Edge Chasing (cont’d) Detection: receive probes and decide whether deadlock has occurred and whether to forward the probes. When a server receives a probe TU and finds the transaction that U is waiting for, say V, is waiting for another data item elsewhere, a probe TUV is forwarded. Resolution: select a transaction in the cycle to abort

Probes for Detecting Deadlocks Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Independently Initiated Probes Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Probes Traveling Downhill Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Types of Entry in a Recovery File Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Log for Banking Service Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Shadow Versions Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

A Log for the Two-Phase Commit Protocol Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Recovery of the Two-Phase Commit Protocol Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.

Recovery of the Two-Phase Commit Protocol Source: G. Coulouris et al., Distributed Systems: Concepts and Design, Third Edition.