RELIABILITY
Reading Textbook: Ch. 12.4 Farkas CSCE 824 - Spring 2011
Design Issues Placing of data and programs (DBMS and application) Network issues Farkas CSCE 824 - Spring 2011
Data Distribution Fully redundant Partially redundant Partitioned: each data item is stored at exactly one site How can we guaranty atomicity of transactions? Farkas CSCE 824 - Spring 2011
Distributed Processing Site A Site B T2 Site C T3 T1 Distributed DBMS Site D T4 T: must be atomic Farkas CSCE 824 - Spring 2011
Distributed Reliability Protocols Ensure that distributed transactions are atomic Protocol evaluation: Max. number of messages Max. number of log forces Checkpoint: for recovery, indicates the latest consistent point (undo has to go back to this point, recovery can start from this point) Farkas CSCE 824 - Spring 2011
Reliability Protocols 2-Phase Commit Presumed Commit Early-Prepare Commit Presumed Abort Farkas CSCE 824 - Spring 2011
Two-Phase Commit 1. Coordinator Participant User initiates transaction T at the site that acts as a coordinator C. C sends the appropriate work request to the participants. (N number of messages) Executes the work request and sends reply to C. (N number of messages) User issues a commit command. C sends a prepare-to-commit message to each participant. (N number of messages) Farkas CSCE 824 - Spring 2011
Two-Phase Commit 2. Coordinator Participant Window of Uncertainty (If the participant voted yes, it cannot decode whether to commit or abort until hears from C) If the participant is able to commit, it forces a prepare log record and sends a yes vote to C. (N forces, N messages) If the participant cannot commit, it forces an abort log record and sends a no vote to C. (N forces, N messages) Farkas Farkas CSCE 824 - Spring 2011 CSCE 824 - Spring 2011 9
Two-Phase Commit 3. Coordinator Participant If all votes were yes, C forces a commit log record and sends a commit message to all participants (1 force, N messages) At this point the user can be told that the transaction has been committed. If even one node voted no, C forces an abort log record that contains transaction membership and sends an abort message to each participant that voted yes or didn’t send a vote. At this point, the user can be told that the transaction has been aborted. W Of U R T Y 10 Farkas CSCE 824 - Spring 2011
Two-Phase Commit 4. Coordinator Participant When the participant receives a commit message from C, it forces a commit log record, sends an ACK to C, and forgets about the transaction. (N forces, N messages) If it receives an abort message, the participant forces an abort log record, sends an ACK to C, and forgets about the transaction. After receiving ACKs from all participants, C writes an end-of-transaction record to the log and forgets about the transaction. Farkas Farkas CSCE 824 - Spring 2011 CSCE 824 - Spring 2011 11
Efficiency of 2-Phase Commit Total number of messages: 6N Log forces; 2N +1 Can be combined with 2-Phase locking Farkas CSCE 824 - Spring 2011
Next Lectures Replica Update Protocols Farkas CSCE 824 - Spring 2011