Providing High Availability Using Lazy Replication Rivaka Ladin
Providing High Availability Using Lazy Replication Rivaka Ladin, Barbara Liskov, Liuba Shrira, Sanjay Ghemawat Presented by Huang-Ming Huang
Outline n n Model Algorithm Performance Analysis Discussion
Replication Model client FE Front ends client FE RM Service RM RM Replication Manager Excerpt from “Distributed Systems – Concept and Design” by Coulouris, Dollimore and Kindberg
System Guarantees n n Each client obtains a consistent service over time Relaxed consistency between replicas n Updates are applied with ordering guarantees that make the replicas sufficiently similar.
Operation Classification RM RM RM gossip Update, prev Val, new Query, prev Update id FE query Client FE val update Client Excerpt from “Distributed Systems – Concept and Design” by Coulouris, Dollimore and Kindberg
Update operation classification n Causal update Forced update : performed in the same order (relative to one another) at all replicas. Immediate update : performed at all replicas in the same order relative to all other operations.
Vector timestamp n Given two timestamps n n n T = (t 1, t 2, , tn) S = (s 1, s 2, , sn) T ≤ S ≡ti≤si for all i merge(T, S)= (max(t 1, s 1), …, max(tn, sn)) Each part of the vector timestamp corresponds to each replica manager in the system.
RM components Other replicas Replica Timestamp Replica log Gossip Messages Timestamp table Replica timestamp Update log stable Value Timestamp updates Value Executed operation table Updates FE FE Operation prev id Excerpt from “Distributed Systems – Concept and Design” by Coulouris, Dollimore and Kindberg
Query n The replica manager blocks the query q operation until the condition holds: n n n q. prev <= value. TS The replica manger returns value. TS back to FE. FE updates its own timestamp n front. End. TS : = merge(front. End. TS, new)
Causal Update Replication Manager i Value. TS merge(Value. TS, r. ts) +1, …, r (r 1, r 2, …, ri, …, r n) n) Value apply(value. r. u. op) Update log executed r. u. id table Executed operation ts=(p r. u. prev ≤i+1, …, p value. TSn) 1, p 2, …, p log. Record =(i, ts, u. op, u. prev, u. id) ts FE operation (p 1, p 2, …pn, ) id
Gossip messages n n Goal : bring the states of replication managers up to date. Consists of : n n n Replication timestamp Update log Upon receiving gossip n n n Merge the arriving log with its own Apply any unexecuted stable updates Eliminate redundant log and executed operation table entries
Control the size of update log n Timestamp table n n n keeps recent timestamps from messages sent by all other replicas. A log record r can be removed from the log when n r. tsr. i < timestamp_table[j] r. i , for all j
Control the size of executed operation table n n Each update carries an extra time field FE returns an ACK n n Contains FE’s clock time after receiving the response for an update from RM. RM inserts the received ACK to the log.
Control the size of executed operation table (con’t) n A message m from FE is late if n n m. time + δ< replica’s clock time An update is discard if it is late An ACK is kept at least until it is late Remove an entry c in executed operation table when n n an ACK for c’s update is received all records for c’s update have been discarded.
Forced Update n n Use the primary to assign a global unique identifier. The primary carries out a two phase protocol for updates.
Two phase protocol n n Upon receiving an update, the primary sends it to all other replicas. Upon receiving responses from all most half of the backups, n n the primary commit the update by insert the record to its log. Backups know the commitment from gossip messages.
Fail Recovery n n n New coordinator informs participants about the failure. Participants inform coordinator about most recent forced updates Coordinator assign UID with the largest it knows after the sub-majority of replicas has responded.
Immediate Update n Primary use 3 phase protocol. n n n Pre-prepare Prepare Commit
3 phase protocol primary FE Update log update Update id log. Record Give me your log and timestamp backup
Number of Messages for different operations n n Query : 2 Casual : 2 + (N-1)/K Forced : 2 N/2 + (N-1)/K Immediate : 2 N +2( N/2 -1)+(N-1)K n n N : the number of replicas K : the number of update/ack pairs in a gossip.
Capacity of a 3 -replica system Excerpt from “Providing high Availability Using Lazy Replication” by Ladin, Liskov, Shrira and Ghemawat
Capacity of the Unreplicated System Excerpt from “Providing high Availability Using Lazy Replication” by Ladin, Liskov, Shrira and Ghemawat
Discussion n No time guarantee for gossip messages n Not generally suitable for real-time application such as n n n realtime conference updating shared document. Scalability n n Timestamp space grows as number of replicas grow. can be increased by making most of the replicas read-only
Qustions?
- Slides: 24