L20.sp11 - Distributed Systems CS 425 / CSE 424 / ECE 428...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Distributed Systems CS 425 / CSE 424 / ECE 428 Distributed Systems CS 425 / CSE 424 / ECE 428 Transactions & Concurrency Control Reading: Sections 13.1-13.7, Chapter 14 010, I . Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou Banking transaction for a customer (e.g., at ATM or browser) Transfer $100 from saving to checking account; Transfer $200 from money-market to checking account; Withdraw $400 from checking account. Transaction (invoked at client): 1. savings.deduct(100) /* includes verification */ 2. checking.add(100) /* depends on success of 1 */ 3. mnymkt.deduct(200) /* includes verification */ 4. checking.add(200) /* depends on success of 3 */ 5. checking.deduct(400) /* includes verification */ 6. dispense(400) 7. commit Example Transaction Example Transaction Client Server Transaction Transaction Transaction Sequence of operations that forms a single step, transforming the server data from one consistent state to another. All or nothing principle: a transaction either completes successfully, and the effects are recorded in the objects, or it has no effect at all. (even with multiple clients, or crashes) A transactions is indivisible (atomic) from the point of view of other transactions No access to intermediate results/states Free from interference by other operations But Transactions could run concurrently, i.e., with multiple clients Transactions may be distributed, i.e., across multiple servers Transaction: 1. savings.deduct(100) 2. checking.add(100) 3. mnymkt.deduct(200) 4. checking.add(200) 5. checking.deduct(400) 6. dispense(400) 7. commit Transaction Failure Modes Transaction Failure Modes A failure at these points means the customer loses money; we need to restore old state A failure at these points does not cause lost money, but old steps cannot be repeated This is the point of no return A failure after the commit point (ATM crashes) needs corrective action; no undoing possible. Bank Server: Coordinator Interface Bank Server: Coordinator Interface Transaction calls that can be made at a client, and return values from the server: openTransaction() -> trans; starts a new transaction and delivers a unique transaction identifier (TID) trans . This TID will be used in the other operations in the transaction. closeTransaction(trans) -> (commit, abort); ends a transaction: a commit return value indicates that the transaction has committed; an abort return value indicates that it has aborted. abortTransaction(trans); aborts the transaction. Bank Server: Account, Branch interfaces Bank Server: Account, Branch interfaces deposit(amount) deposit amount in the account withdraw(amount) withdraw amount from the account getBalance() -> amount return the balance of the account setBalance(amount) set the balance of the account to amount create(name) -> account create a new account with a given name lookup(name) -> account return a reference to the account with the given name branchTotal() -> amount...
View Full Document

This note was uploaded on 02/08/2012 for the course ECE 428 taught by Professor Hu during the Spring '08 term at University of Illinois, Urbana Champaign.

Page1 / 27

L20.sp11 - Distributed Systems CS 425 / CSE 424 / ECE 428...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online