DOC PREVIEW
CMU ISM 95702 - OCT Distributed Transactions

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

OCT Distributed TransactionsHypothetical Web Service TransactionTransactions (ACID)Slide 4Slide 5Object informs participantSuppose all goes well (1)Suppose all goes well (2)This time no cars available (1)This time no cars available (2)This time no cars available (3)Slide 12Slide 13Slide 14Two-Phase Commit ProtocolTwo-Phase Commit Protocol (Gray2PC Finite State Machine from Tanenbaum2PC Blocks in three placesSlide 19Slide 20Slide 21Slide 22Slide 23Slide 24OCT Distributed Transaction 1OCT Distributed TransactionsNotes adapted from Tanenbaum’s “Distributed Systems Principles and Paradigms”OCT Distributed Transaction 2Hypothetical Web Service TransactionBegin transaction BookTrip book plane book hotel book rental carEnd transaction BookTripOCT Distributed Transaction 3Transactions (ACID)•Atomic: All or nothing. No intermediate states are visible.•Consistent: system invariants preserved, e.g., if there were n dollars in a bank before a transfer transaction then there will be n dollars in the bank after the transfer. •Isolated: Two transactions do not interfere with each other. They appear as serial executions.•Durable: The commit causes a permanent change.OCT Distributed Transaction 4Client talks to coordinatorBookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientopenTransUnique Transaction IDTIDRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.TID = openTransaction() Recoverable objects neededto rent a car.Any serverOCT Distributed Transaction 5Client calls methods BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.Call + TIDplane.bookFlight(111,”Seat32A”,TID)Any serverRecoverable objects neededto rent a car.OCT Distributed Transaction 6BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.Object informs participant The participant knows where the coordinator is because that information can be included inthe TID (eg. an IP address.)The coordinator now has a pointer to the participant.The participant onlycalls join if it has notalready done so.join(TID,ref to participant)OCT Distributed Transaction 7BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.Suppose all goes well (1) OK returnedOK returnedOK returnedRecoverable objects neededto rent a car.OCT Distributed Transaction 8BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.Suppose all goes well (2) OK returnedOK returnedOK returnedCloseTransaction(TID) Called Coordinator begins2PC and this results ina GLOBAL COMMITsent to each participant.Recoverable objects neededto rent a car.OCT Distributed Transaction 9BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.This time no cars available (1)OK returnedOK returnedNO CARS AVAILabortTransaction(TID) calledRecoverable objects neededto rent a car.OCT Distributed Transaction 10BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.This time no cars available (2)OK returnedOK returnedNO CARS AVAILabortTransaction(TID) calledCoordinator sends a GLOBAL_ABORT to allparticpantsRecoverable objects neededto rent a car.OCT Distributed Transaction 11BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientROLLBACK CHANGESROLLBACK CHANGESThis time no cars available (3)OK returnedOK returnedNO CARS AVAIL abortTransaction(TID)abortTransaction Each participantGets a GLOBAL_ABORTROLLBACK CHANGESOCT Distributed Transaction 12BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.BookPlane Server Crashes after returning ‘OK’ (1)OK returnedOK returnedOK returnedRecoverable objects neededto rent a car.OCT Distributed Transaction 13BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane Recoverable objects neededto book a hotel.BookPlane Server Crashes after returning ‘OK’ (2)OK returnedOK returnedOK returnedCloseTransaction(TID) Called Coordinator excutes 2PC:Ask everyone to vote.No news from the BookPlaneParticipant so multicast a GLOBAL ABORTRecoverable objects neededto rent a car.OCT Distributed Transaction 14BookTrip CoordinatorBookPlane ParticipantBookHotel ParticipantBookRentalCar ParticipantDifferent serversBookTrip ClientRecoverable objects neededto book a plane ROLLBACKBookPlane Server Crashes after returning ‘OK’ (3)OK returnedOK returnedOK returnedCloseTransaction(TID) Called ROLLBACKGLOBAl ABORTROLLBACKOCT Distributed Transaction 15Two-Phase Commit ProtocolBookTripCoordinator BookPlaneBookHotelBookRentalCarPhase 1 BookTrip coordinator sends a Vote_Request to each process. Each process returns a Vote_Commit or Vote_Abort.Vote_RequestVote RequestVote RequestVote_CommitVote CommitVote CommitOCT Distributed Transaction 16Two-Phase Commit Protocol (Gray BookTripCoordinator BookPlaneBookHotelBookRentalCarPhase 2 BookTrip coordinator checks the votes. If every process votes to commit then so will the coordinator.In that case, it will send a Global_Commit to each process. If any process votes to abort the coordinator sends a GLOBAL_ABORT.Each process waits for a Global_Commit message before committing its part of thetransaction.Global CommitACKGlobal CommitACKGlobal CommitACKOCT Distributed Transaction 172PC Finite State Machine from Tanenbaum


View Full Document

CMU ISM 95702 - OCT Distributed Transactions

Documents in this Course
Homework

Homework

12 pages

Lecture

Lecture

25 pages

Lecture

Lecture

21 pages

Lecture

Lecture

24 pages

Exam

Exam

11 pages

Homework

Homework

16 pages

Homework

Homework

38 pages

lecture

lecture

38 pages

review

review

7 pages

lecture

lecture

18 pages

review

review

8 pages

Chapter2

Chapter2

32 pages

Lecture 4

Lecture 4

47 pages

Lecture

Lecture

22 pages

Naming

Naming

26 pages

lecture

lecture

34 pages

lecture

lecture

42 pages

lecture

lecture

112 pages

Lecture

Lecture

33 pages

Axis

Axis

43 pages

lecture

lecture

32 pages

review

review

17 pages

Lecture

Lecture

53 pages

Lecture

Lecture

80 pages

Lab

Lab

14 pages

Load more
Download OCT Distributed Transactions
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view OCT Distributed Transactions and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view OCT Distributed Transactions 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?