60 likes | 154 Views
Distributed Systems. Session 3 Addendum: More on Transactions. CSC 253 Gordon Blair, François Ta ïani. Distributed Transaction: An Example. client. H. C. book hotel NYC 1 week. book flight Paris-NYC. End_Transaction. Begin_Transaction. option on 1 week. available. OK. Co. available.
E N D
Distributed Systems Session 3 Addendum:More on Transactions CSC 253 Gordon Blair, François Taïani
Distributed Transaction:An Example client H C book hotel NYC 1 week book flight Paris-NYC End_Transaction Begin_Transaction option on 1 week available OK Co available option on 1 seat Begin_Transactionbook hotel NYC 1 week book flight Paris-NYCEnd_Transaction Begin_Transactionbook hotel NYC 1 week book flight Paris-NYCEnd_Transaction Begin_Transactionbook hotel NYC 1 week book flight Paris-NYCEnd_Transaction Begin_Transactionbook hotel NYC 1 week book flight Paris-NYCEnd_Transaction Begin_Transactionbook hotel NYC 1 week book flight Paris-NYCEnd_Transaction coordinator F participants(servers) G. Blair/ F. Taiani
commit commit yes:Th yes:Tf (a) Commit Succeeds client H C canCommit? doCommit haveCommited yes Co Transaction OK canCommit? yes doCommit haveCommited What was it again? Begin_Transactionbook hotel NYC 1 week book flight Paris-NYCEnd_Transaction F participants(servers) G. Blair/ F. Taiani
Important Points • Once the coordinator has sent doCommit only a commit is possible • If one of the participants fails: • Transaction is blocked until the participant resumes • Consistency is ensured because of transaction state being saved on stable storage • On resuming the failed participants check its disk to know which transactions to ask the coordinator about • Many details not represented • The coordinator uses stable storage as well against failure • Distributed locking protocol omitted • Typically multiple clients performing transaction at the same time G. Blair/ F. Taiani
abort abort Transaction failed (b) Commit Fails client H C canCommit? abort Co canCommit? yes What was it again? abort Begin_Transactionbook hotel NYC 1 week book flight Paris-NYCEnd_Transaction F yes:Tf participants(servers) G. Blair/ F. Taiani
Important Points • Same basic mechanisms as when everybody agrees • Except here no need to wait for failed servers: • It is the responsibility of the failed servers to catch up • The failed server still need to check with the coordinator • It does not know the outcome of the transaction • The transaction could have succeeded G. Blair/ F. Taiani