Presentation is loading. Please wait.

Presentation is loading. Please wait.

RELIABILITY.

Similar presentations


Presentation on theme: "RELIABILITY."— Presentation transcript:

1 RELIABILITY

2 Reading Textbook: Ch. 12.4 Farkas CSCE Spring 2011

3 Design Issues Placing of data and programs (DBMS and application)
Network issues Farkas CSCE Spring 2011

4 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 Spring 2011

5 Distributed Processing
Site A Site B T2 Site C T3 T1 Distributed DBMS Site D T4 T: must be atomic Farkas CSCE Spring 2011

6 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 Spring 2011

7 Reliability Protocols
2-Phase Commit Presumed Commit Early-Prepare Commit Presumed Abort Farkas CSCE Spring 2011

8 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 Spring 2011

9 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 Spring 2011 CSCE Spring 2011 9

10 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 Spring 2011

11 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 Spring 2011 CSCE Spring 2011 11

12 Efficiency of 2-Phase Commit
Total number of messages: 6N Log forces; 2N +1 Can be combined with 2-Phase locking Farkas CSCE Spring 2011

13 Next Lectures Replica Update Protocols Farkas CSCE Spring 2011


Download ppt "RELIABILITY."

Similar presentations


Ads by Google