







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Notes on distributed transactions, covering failure models, node models (fail-stop and byzantine), network models (reliable and partitionable), scenarios, and process models (cohorts and transaction servers).
Typology: Slides
1 / 13
This page cannot be seen from the preview
Don't miss anything!








CS 347 Notes06 7
Desired Events Expected Undesired Unexpected
CS 347 Notes06 8
(1) Fail-stop nodes time perfect halted recovery perfect
Volatile memory lost Stable storage ok
CS 347 Notes06 9
(2) Byzantine nodes A Perfect Perfect Arbitrary failure Recovery B
C
At any given time, at most some fraction f of nodes failed (typically f < 1/2 or f < 1/3)
CS 347 Notes06 10
(1) Reliable network
I.e., no lost messages, except for node failures
If no ack in TD sec. Destination down(not paused)
CS 347 Notes06 11
CS 347 Notes06 12
(2) Partitionable network
CS 347 Notes06 13
CS 347 Notes06 14
net P^ Item X
CS 347 Notes06 15
net P^ Item X
“P controls X” means
CS 347 Notes06 17
PT is process that represents T at this node
req
Local DMBS
Lock mgr LOG^ X
CS 347 Notes06 18
(A) Cohorts Spawn process Communication USER Data Access
Local DMBS
Local DMBS
Local DMBS
CS 347 Notes06 25
-> Example: after participant fails: Log: T 1 X undo/redo info
Y ... (^) info ...
“W” state
CS 347 Notes06 26
CS 347 Notes06 27
CS 347 Notes06 28
CS 347 Notes06 29
Coordinator I
go exec*
c-ok*
nok*
nok abort*
ok* commit*
t=timeout cping=coord. ping CS 347 Notes06 30
Coordinator I
go exec*
c-ok*
nok*
ping
ping abort
ping commit t cping
t abort*
nok abort*
ok* commit*
t=timeout cping=coord. ping
CS 347 Notes06 31
Participant
I
exec ok
exec nok
commit c-ok
abort nok
CS 347 Notes06 32
Participant
I
exec ok
exec nok
commit c-ok
abort cping- , _tping nok
cping done
cping done “done” message counts as either c-ok or n-ok for coordinator
CS 347 Notes06 33
Participant
I
exec ok
equivalent to finish state
exec nok
commit c-ok
abort cping- , _tping nok
cping done
cping done “done” message counts as either c-ok or n-ok for coordinator CS 347 Notes06 34
CS 347 Notes06 35
Presumed abort-coordinator (participant unchanged)
I
go exec* ping
ping abort
ping commit (^) t cping
nok, t abort*
ok* commit*
CS 347 Notes06 36
Example: tracking who has sent “OK” msgs Log at coord:
start part={a,b}
OK froma RCV
CS 347 Notes06 43
Coordinator Participant I
go exec*
ack* commit*
nok abort* ok* pre *
exec ok
commit
exec nok
pre ack
abort
CS 347 Notes06 44
survivors
CS 347 Notes06 45
survivors CS 347 Notes06 46
CS 347 Notes06 47
CS 347 Notes06 48
CS 347 Notes06 49
CS 347 Notes06 50
select new coordinator to continue 3PC
P P C C W P C C W P P C Decide to commit Time 1
Time 2
Time 3
Time 4
CS 347 Notes06 51
Note: when survivors continue 3PC, failed nodes do not count E.g., “OK*” when OK’s received from W non-failed nodes
ok* pre*
CS 347 Notes06 52
Note: 3PC unsafe with partitions!
W W W
P
P
abort (^) commit
CS 347 Notes06 53
W
W
CS 347 Notes06 54
W
W
later on...
CS 347 Notes06 61
Example(1): Coord P 2 W P 1 P 3 W p 4 W
CS 347 Notes06 62
Example(1): Coord P 2 W P 1 P 3 W p 4 W
CS 347 Notes06 63
Example(2): Coord P 3 ”P” P 1 P 4 ”W” P 2
CS 347 Notes06 64
Example(2): Coord P 3 ”P” P 1 P 4 ”W” P 2
CS 347 Notes06 65
Summary: Majority rule ensures that any decision (e.g., Preparing, committing) will be known to any future group making a decision
decision # 2
decision
CS 347 Notes06 66
W
W
CS 347 Notes06 67
W
W
W
CS 347 Notes06 68
go exec*
ackC* commit*
nok ok* preA* preC *
exec ok
commit
exec nok
preC ackC
preA ackA
coordinator participant
ackA* abort*
abort
CS 347 Notes06 69
CS 347 Notes06 70
OK to commit since transaction could not have aborted
CS 347 Notes06 71
CS 347 Notes06 72
No decision: Transaction could have aborted or could have committed... Block!
CS 347 Notes06 79
T T
T T
e.g., central detection node
CS 347 Notes06 80
T T
T T
T T
T T
Time 1
Time 2
Time 3
info sent
info sent
T T
at centralsite:
CS 347 Notes06 81