Professional Documents
Culture Documents
Fault Tolerance Notes
Fault Tolerance Notes
Fault Tolerance
Part I Introduction
Part II Process Resilience
Part III Reliable Communication
Part IV Distributed Commit
Part V Recovery
CSCE455/855 Distributed Operating Systems
Fault Tolerance
Part I
Introduction
Fault Tolerance
• A DS should be fault-tolerant
– Should be able to continue functioning in the
presence of faults
Dependability Includes
• Availability
• Reliability
• Safety
• Maintainability
Availability & Reliability (1)
Fault Tolerance
Part II
Process Resilience
Process Resilience
• Mask process failures by replication
🕿
🕿
🕿
🕿
Byzantine Generals -Example (1)
Fault Tolerance
Part III
Reliable Communication
Reliable Group
Communication
Reliable Group Communication
B B
C C
Gi = (A, B, C) Gi+1 = (B, Gi = (A, B, C) Gi+1 = (B,
C) C)
Virtual Synchronous Multicast
B B
C C
Gi = (A, B, C) Gi+1 = (B, Gi = (A, B, C) Gi+1 = (B,
C) C)
Virtual Synchronous Multicast
a) ???
C
Gi = (A, B, C) Gi+1 = (B,
C)
Reliability of Group Communication?
• A sent message is received by all members
(acks from all => ok)
• Problem: during a multicast operation
– an old member disappears from the group
– a new member joins the group
• Solution
– membership changes synchronize multicasting
⇒ during a MC operation no membership changes
– Virtual synchrony: “all” processes see message and membership
change in the same order
Virtual Synchronous Multicast
B B
C C
Gi = (A, B, C) Gi+1 = (B, Gi = (A, B, C) Gi+1 = (B,
C) C)
Virtual Synchrony Implementation:
[Birman et al., 1991]
• Only stable messages are delivered
• Stable message: a message received by all processes in
the message’s group view
• Assumptions (can be ensured by using TCP):
– Point-to-point communication is reliable
– Point-to-point communication ensures FIFO-ordering
• How to determine if a message is stable?
Virtual Synchrony Implementation:
Example
• Gi = {P1, P2, P3, P4, P5}
• P5 fails
P2 P3
• P1 detects that P5 has failed
• P1 send a “view change” message
to every process in Gi+1 = {P1,
P2, P3, P4} P1 change view
P4
P5
Virtual Synchrony Implementation:
Example
• Every process unstable message
– Send each unstable message P2 P3
m from Gi to members in Gi+1
– Marks m as being stable
– Send a flush message to mark
that all unstable messages P1
have been sent flush
P4
message
P5
Virtual Synchrony Implementation:
Example
Every process
– After receiving a flush message P2 P3
from all processes in Gi+1 installs
Gi+1
P1
P4
P5
Announcement
• Notes:
– Commit requires a set of processes to agree…
– …similar to the Byzantine generals problem…
– … but the solution much simpler because stronger
assumptions
Distributed Transactions
client ser-
ver
Database ser-
Atomic
atomic ver
Consistent
isolated
Isolated
serializable
Durable ser-
Database
ver
client
A Distributed Banking Transaction
openTransaction join participan
closeTransaction t
A a.withdraw(4);
.
join
Branch
X
T
participan
t
Clien B b.withdraw(3);
t
T = openTransaction
join Branch
Y
a.withdraw(4);
participan
c.deposit(4); t
b.withdraw(3); C c.deposit(4);
d.deposit(3);
closeTransaction D d.deposit(3);
Branch
Z
One-phase Commit
• One-phase commit protocol
– One site is designated as a coordinator
– The coordinator tells all the other processes whether
or not to locally perform the operation in question
– This scheme however is not fault tolerant
Transaction Processing (1)
S1 F1
coordinator T_Id
client flag: init
…. P1 27
Open transaction
T_write F1,P1 join
T_write F2,P2 S2 F2
T_write F3,P3 T_Id
Close transaction flag: init
…. participant P2 27
S3 F3
T_Id
participant flag: init
P3 2745
Transaction Processing (2)
F1
Close coordinator T_Id
client init
committed
wait
done
…. doCommit !
canCommit?
P1 27
Open transaction
T_read F1,P1
T_write F2,P2 Yes
HaveCommitted
T_write F3,P3 T_Id
Close transaction committed
ready
init
…. P2 27
Yes
HaveCommitted
T_Id
committed
ready
init
P3 2745
Two Phase Commit (2PC)
Coordinator Participants
State of Q Action by P
Fault Tolerance
Part V
Recovery
Recovery
● Examples:
● Reliable communication via erasure correction,
such as an (n, k) block erasure code
More on Backward Recovery
● How?
Obvious First Solution…
• Problems?
● Time synchronization possible only approximately
● distributed banking applications: no approximations!
● + So simple!!
● - Correct??
Example
Producer Consumer problem
p q
p q
m
Example
p q
m m
● Result:
● Global state has record of the receive event but no
send event violating the happens-before concept!!
Cut