CSE 486/586 Distributed Systems Concurrency Control --- 3

Slides:



Advertisements
Similar presentations
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
Advertisements

CS542: Topics in Distributed Systems Distributed Transactions and Two Phase Commit Protocol.
Slides for Chapter 13: Distributed transactions
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Byzantine Fault Tolerance Steve Ko Computer Sciences and Engineering University at Buffalo.
CIS 720 Concurrency Control. Timestamp-based concurrency control Assign a timestamp ts(T) to each transaction T. Each data item x has two timestamps:
Copyright © George Coulouris, Jean Dollimore, Tim Kindberg This material is made available for private study and for direct.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Concurrency Control Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Concurrency Control Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Concurrency Control Steve Ko Computer Sciences and Engineering University at Buffalo.
Persistent State Service 1 Distributed Object Transactions  Transaction principles  Concurrency control  The two-phase commit protocol  Services for.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 11: Transactions Dr. Michael R. Lyu Computer Science & Engineering.
CS 425 / ECE 428 Distributed Systems Fall 2014 Indranil Gupta (Indy) Lecture 18: Replication Control All slides © IG.
Distributed Systems Fall 2009 Distributed transactions.
Distributed Commit Dr. Yingwu Zhu. Failures in a distributed system Consistency requires agreement among multiple servers – Is transaction X committed?
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.
Lecture 12: Distributed transactions Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
CSE 486/586 CSE 486/586 Distributed Systems Concurrency Control Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Concurrency Control Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Transactions CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Nikita Borisov - UIUC Material derived from slides by I. Gupta, M. Harandi,
DISTRIBUTED SYSTEMS II FAULT-TOLERANT AGREEMENT II Prof Philippas Tsigas Distributed Computing and Systems Research Group.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Replication Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Transactions Chapter – Vidya Satyanarayanan.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Mutual Exclusion & Leader Election Steve Ko Computer Sciences and Engineering University.
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.
A client transaction becomes distributed if it invokes operations in several different Servers There are two different ways that distributed transactions.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Replication Steve Ko Computer Sciences and Engineering University at Buffalo.
TRANSACTION & CONCURRENCY CONTROL 1. CONTENT 2  Transactions & Nested transactions  Methods for concurrency control  Locks  Optimistic concurrency.
CSE 486/586 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Transactions on Replicated Data Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Paxos Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586 CSE 486/586 Distributed Systems Leader Election Steve Ko Computer Sciences and Engineering University at Buffalo.
10-Jun-16COMP28112 Lecture 131 Distributed Transactions.
CSE 486/586, Spring 2014 CSE 486/586 Distributed Systems Paxos Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Consistency Steve Ko Computer Sciences and Engineering University at Buffalo.
CSE 486/586 Distributed Systems Leader Election
CSE 486/586 Distributed Systems Consistency --- 1
Two phase commit.
Outline Announcements Fault Tolerance.
CSE 486/586 Distributed Systems Concurrency Control --- 1
CSE 486/586 Distributed Systems Consistency --- 1
Replication and Recovery in Distributed Systems
J2EE Lecture 12: Transaction
CSE 486/586 Distributed Systems Leader Election
CSE 486/586 Distributed Systems Concurrency Control --- 2
CSE 486/586 Distributed Systems Concurrency Control --- 3
Slides for Chapter 14: Distributed transactions
Distributed Transactions
Lecture 21: Replication Control
Distributed Transactions
Exercises for Chapter 14: Distributed Transactions
Distributed Databases Recovery
Distributed Transactions
UNIVERSITAS GUNADARMA
Distributed Transactions
Distributed Systems Course Distributed transactions
Distributed Transactions
TRANSACTION & CONCURRENCY CONTROL
CSE 486/586 Distributed Systems Concurrency Control --- 2
CSE 486/586 Distributed Systems Concurrency Control --- 1
Lecture 21: Replication Control
CSE 486/586 Distributed Systems Consistency --- 3
CIS 720 Concurrency Control.
CSE 486/586 Distributed Systems Leader Election
CSE 486/586 Distributed Systems Mid-Semester Overview
Brahim Ayari, Abdelmajid Khelil and Neeraj Suri
Presentation transcript:

CSE 486/586 Distributed Systems Concurrency Control --- 3 Steve Ko Computer Sciences and Engineering University at Buffalo

Recap Strict execution of transactions? Two phase locking? Delay both their read and write operations on an object until all transactions that previously wrote that object have either committed or aborted Two phase locking? Growing phase Shrinking phase Strict two phase locking? Release locks only at either commit() or abort()

CSE 486/586 Administrivia PA3 deadline: 4/8 (Friday) PA2-B & Midterm grades on UBLearns I will post midterm (letter) grades to show you where you are at this point.

Distributed Transactions Transactions that invoke operations at multiple servers T11 A A X T1 H T T12 B T B T21 C Y T2 K D C T22 F D Z Flat Distributed Transaction Nested Distributed Transaction

Coordinator and Participants In charge of begin, commit, and abort Participants Server processes that handle local operations join Participant Coordinator A X join Participant join T B Y Participant C D Z Coordinator & Participants

Example of Distributed Transactions . BranchZ BranchX participant C D Client BranchY B A join T a.withdraw(4); c.deposit(4); b.withdraw(3); d.deposit(3); openTransaction b.withdraw(T, 3); closeTransaction T = Note: the coordinator is in one of the servers, e.g. BranchX

Atomic Commit Problem Atomicity principle requires that either all the distributed operations of a transaction complete, or all abort. At some stage, client executes commit(). Now, atomicity requires that either all participants (remember these are on the server side) and the coordinator commit or all abort. What problem statement is this? Consensus Failure model Arbitrary message delay & loss Crash-recovery with persistent storage

Atomic Commit We need to ensure safety in real-life implementation. Never have some agreeing to commit, and others agreeing to abort. First cut: one-phase commit protocol. The coordinator communicates either commit or abort, to all participants until all acknowledge. What can go wrong? Does not allow participant to abort the transaction, e.g., under deadlock. Doesn’t work well with failures (e.g., when a participant crashes before receiving this message). Need to have some extra mechanism.

Two-Phase Commit (Handling Abort) First phase Coordinator collects a vote (commit or abort) from each participant (which stores partial results in permanent storage before voting). Second phase If all participants want to commit, coordinator multicasts commit message If any participant has aborted, coordinator multicasts abort message to all participants

Two-Phase Commit Communication canCommit? Yes doCommit haveCommitted Coordinator 1 3 (waiting for votes) committed done prepared to commit step Participant 2 4 (uncertain) status

Dealing with Failures To deal with server crashes Each participant saves tentative updates into permanent storage, right before replying yes/no in first phase. Retrievable after crash recovery. To deal with canCommit? loss The participant may decide to abort unilaterally after a timeout (coordinator will eventually abort) To deal with Yes/No loss, the coordinator aborts the transaction after a timeout (pessimistic). It must announce doAbort to those who sent in their votes. To deal with doCommit loss The participant may wait for a timeout, send a getDecision request (retries until reply received) – cannot abort after having voted Yes but before receiving doCommit/doAbort!

Problems with 2PC It’s a blocking protocol. Scalability & availability issues

Summary Increasing concurrency Distributed transactions Non-exclusive locks Two-version locks Hierarchical locks Distributed transactions One-phase commit cannot handle failures & abort well Two-phase commit mitigates the problems of one-phase commit Two-phase commit has its own limitation: blocking

Acknowledgements These slides contain material developed and copyrighted by Indranil Gupta (UIUC).