Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 603 Distributed Transactions February 18, 2002.

Similar presentations


Presentation on theme: "CS 603 Distributed Transactions February 18, 2002."— Presentation transcript:

1 CS 603 Distributed Transactions February 18, 2002

2 What is a Transaction? A tomic –T–The external view is that either everything in the transaction happened, or nothing did C onsistent –I–If the start state is valid, the end state is valid I solated –A–A transaction in process is not affected by and does not affect any other transaction D urable –O–Once complete, the effects of a transaction are permanent, even in the event of failure.

3 Distributed Transactions What is the difference with Distributed Transactions? –NOTHING! –Must still support ACID properties –Important for all the same reasons Why do we study Distributed Transactions? –Some properties harder to implement –Basic single-system techniques not sufficient

4 What is a Distributed Transaction? Transaction component Data Transaction component Data Transaction component Data Transaction component Data

5 Why are Distributed Transactions Hard? A tomic –D–Different parts of a transaction may be at different sites –H–How do we ensure all or none committed? C onsistent –F–Failure may affect only part of transaction I solated –C–Commitment must occur “simultaneously” at all sites D urable –N–Not much different when other problems solved –M–Makes “delayed commit” difficult

6 Key Issues Commitment –Standard techniques preserve properties when commit occurs –Distributed systems need commit protocols so we know when commit has occurred Failures –Standard techniques support durability for commit/abort –What happens if a site fails during commitment?

7 Committing a Distributed Transaction Transaction component Data log Transaction component Data log Transaction component Data log Transaction component Data log

8 Two-Phase Commit (Lamport ’76, Gray ’79) Assumes central coordinator –Coordinator initiates protocol –Participants: entities with actions to be committed/aborted Phase 1: –Coordinator asks if participants can commit –Participants respond yes/no Phase 2: –If all votes yes, coordinator sends Commit Otherwise send Abort –Participants send Have Committed / Have Aborted

9 Two-Phase Commit Transaction component Data log Transaction component Data log Transaction component Data log Transaction component Data log Coordinator CanCommit? Yes Commit Done

10 Two-Phase Commit: Fault Tolerance Participant fails in Phase 1: –Coordinator doesn’t get unanimous yes –Abort Participant fails in Phase 2: –On reawakening, can ask coordinator if it should commit or abort –Requires that both commit and abort states be durable before sending “yes” vote

11 Two-Phase Commit: Problems Blocks on failure –Timeout before abort if participant fails –All participants must wait for recovery if coordinator fails While blocked, transaction must remain Isolated –Hold locks on data items touched –Prevents other transactions from completing Solution: Wednesday


Download ppt "CS 603 Distributed Transactions February 18, 2002."

Similar presentations


Ads by Google