Chapter 1: Introduction

RELIABILITY
Reading

Farkas
Textbook: Ch. 12.4
CSCE 824 - Spring 2011
2
Design Issues


Farkas
Placing of data and programs
(DBMS and application)
Network issues
CSCE 824 - Spring 2011
3
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
4
Distributed Processing
Site A
Site B
T2
Site C
T3
T1
Distributed DBMS
T:
Farkas
T4
Site D
must be atomic
CSCE 824 - Spring 2011
5
Distributed Reliability
Protocols



Farkas
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)
CSCE 824 - Spring 2011
6
Reliability Protocols




Farkas
2-Phase Commit
Presumed Commit
Early-Prepare Commit
Presumed Abort
CSCE 824 - Spring 2011
7
Two-Phase Commit 1.
Coordinator
P
R
E
P
A
R
E
P
H
A
S
E
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
8
Two-Phase Commit 2.
Coordinator
Window of
Uncertainty (If the
participant voted
yes, it cannot
decode whether to
commit or abort
until hears from C)
Farkas
Participant
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)
CSCE 824 - Spring 2011
9
Two-Phase Commit 3.
D
E
C
I
S
I
O
N
P
H
A
S
E
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.
W
I
N
D
O
W
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.
Farkas
CSCE 824 - Spring 2011
Of
U
N
C
E
R
T
A
I
N
T
Y
10
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
CSCE 824 - Spring 2011
11
Efficiency of 2-Phase
Commit



Farkas
Total number of messages: 6N
Log forces; 2N +1
Can be combined with 2-Phase
locking
CSCE 824 - Spring 2011
12
Next Lectures

Farkas
Replica Update Protocols
CSCE 824 - Spring 2011
13