CS 347 Prllel nd Distriuted Dt Proessing Spring 06 Network Prtitions Susets of nodes m e isolted or nodes m e slow in responding Notes 8: Network Prtitions CS 347 Notes 8 Network Prtitions Cuses ired network disruptions E.g., due to nturl disster ireless network ostles (Semi-)utonomous nodes Single node filures undistinguishle from prtitions E.g., network rd fils Prtitions without Replition If some dt is unville then stuk Even if ll dt is ville, must ope with prtition during ommit protool C C C A A CS 347 Notes 8 3 CS 347 Notes 8 4
d C = { {,, }, {,, d }, {,, d }, {,, d } } A = { {, }, {, }, {, d }, {, }, {, d }, {, d } } Importnt propert X C Y A: X Y Y A X C: X Y Vote ssignments One w to implement quorums V C + V A > V T V C V A V T votes to ommit votes to ort totl votes d to ommit V C 3 to ort V A CS 347 Notes 8 5 CS 347 Notes 8 6 Commit protools must enfore quorum If node knows trnstion ould hve ommitted (orted), it nnot ort (ommit) even if ort (ommit) quorum ville All ommit protools re loking (with network prtitions) 3PC with quorum To mke ommit deision: ommit quorum To mke ort deision: ort quorum Emple Votes for ommit V C = 3 Votes for ort V A = 3 old oordintor? new oordintor CS 347 Notes 8 7 CS 347 Notes 8 8
Emple old oordintor? new oordintor V C = 3 V A = 3 Emple old oordintor? PC new oordintor V C = 3 V A = 3 Coordintor ould not hve ommitted Hve ort quorum Tr to ort CS 347 Notes 8 9 CS 347 Notes 8 0 Emple old oordintor? PC new oordintor V C = 3 V A = 3 Emple 3 old oordintor? PC new oordintor V C = 3 V A = 3 Coordintor ould not hve orted Hve ommit quorum Tr to ommit CS 347 Notes 8 CS 347 Notes 8
Emple 3 old oordintor? PC new oordintor V C = 3 V A = 3 Prolemti stte PC PA Insuffiient votes Blok Possile? Could the trnstion hve orted? Could the trnstion hve ommitted? ht to do net? CS 347 Notes 8 3 CS 347 Notes 8 4 Prolemti stte PC Senrio { PC, PA, } fter ommit = oordintor PA PC?? PC PC C? Possile? Yes Could the trnstion hve orted? Yes Could the trnstion hve ommitted? Yes ht to do net? Blok PC C? PC PC PC PA??? PA??? time CS 347 Notes 8 5 CS 347 Notes 8 6
Senrio { PC, PA, } fter ort PA A? PA A? PC??? PC PA PA PA??? time CS 347 Notes 8 7 Not ll quorums n e implemented vi votes C = { {, }, {, d } } A = { {, }, {, d }, {, }, {, d } } d CS 347 Notes 8 8 Prtitions with Replition Options. All opies re required for updtes. Groups m updte, ut t most one t time 3. An group m updte Prtitions with Replition At most one opertionl group Updte propgtion Multiple opertionl groups CS 347 Notes 8 9 CS 347 Notes 8 0
Ke ide hen opertionl groups hnge, t lest one node should e shred ross previous group nd urrent group, so tht it n rr over stte d C = { {,, }, {,, d }, {,, d }, {,, d } } C = { {, }, {, }, {, d }, {,, d } } Importnt propert X C Y C: X Y { {, }, {, d } } not vlid CS 347 Notes 8 CS 347 Notes 8 Reding replited dt Cn rel oterie requirement Votes V > V T, V + V R > V T C = { {,, }, {,, d }, {,, d }, {,, d } } R = { {, }, {, }, {, d }, {, }, {, d }, {, d } } To write get 3 votes ( V ) To red get votes ( V R ) C = R = { {, }, {, }, {, d }, {,, d } } C = { {,, }, {,, d }, {,, d }, {,, d } } R = { {, }, {, }, {, d }, {, }, {, d }, {, d } } d CS 347 Notes 8 3 CS 347 Notes 8 4
Votes V > V T, V + V R > V T To write get 3 votes ( V ) To red get votes ( V R ) C = R = { {, }, {, }, {, d }, {,, d } } d hih one is etter? C = { {,, }, {,, d }, {,, d }, {,, d } } R = { {, }, {, }, {, d }, {, }, {, d }, {, d } } C = R = { {, }, {, }, {, d }, {,, d } } CS 347 Notes 8 5 CS 347 Notes 8 6 Not ll oteries hve vote ssignments Not ll oteries hve vote ssignments Emple Nodes {,,, d, e, f } C = { {, }, {,, d }, {,, e }, {, d, f }, {, e, f }, {,, f }, {, d, e } } CS 347 Notes 8 7 CS 347 Notes 8 8
Updte Propgtion Prolem Emple Updte Propgtion Prolem Emple Now T T is ommitted t, Lter T T reds t (not seeing T ) Then writes nd ommits t, T CS 347 Notes 8 9 CS 347 Notes 8 30 Updte Propgtion Updte Propgtion Solution Eh node keeps list of ommitted trnstions Compre list t red site with those t write sites Updte sites tht missed trnstions Solution Emple revisited T 0, T T 0, T T 0 CS 347 Notes 8 3 CS 347 Notes 8 3
Updte Propgtion Solution Emple revisited Updte Propgtion Solution Emple revisited T 0, T T oordintor T 0, T ee (list = T0) T oordintor T 0, T red List = T0 T 0, T ee (list = T0) T 0 T 0 CS 347 Notes 8 33 CS 347 Notes 8 34 Updte Propgtion Solution Emple revisited Updte Propgtion Eh node must keep updtes for trnstions until ll nodes hve seen them T 0, T nok T oordintor T 0, T ok Get new dt ( T ) from T 0 CS 347 Notes 8 35 CS 347 Notes 8 36
Multiple Opertionl Groups DB 3 DB 4 Multiple Opertionl Groups Integrtion options. Compenste trnstions to mke shedules mth. Dt pth (i.e., ppl semnti fi) DB 0 DB DB CS 347 Notes 8 37 CS 347 Notes 8 38 Multiple Opertionl Groups Multiple Opertionl Groups Compenstion Emple T0, T, T Compenstion Assume T ommutes with T 3 nd T 4 E.g., no onfliting opertions T0 DB T0, T, T DB 3 T0 DB DB 3 DB Shedule T 0, T 3, T 4, T is equivlent to T 0, T, T 3, T 4 DB T0, T3, T4 DB T0, T3, T4 DB 3 Shedule T 0, T, T, T -, T 3, T 4is equivlent to T 0, T, T 3, T 4 CS 347 Notes 8 39 CS 347 Notes 8 40
Multiple Opertionl Groups Multiple Opertionl Groups Compenstion T0, T, T DB 3 Compenstion In generl, sed on hrteristis of trnstions, shedules n e merged T0 DB DB 4 T0, T, T3, T4 DB T0, T3, T4 CS 347 Notes 8 4 CS 347 Notes 8 4 Multiple Opertionl Groups Multiple Opertionl Groups Dt pth Forget out shedules Integrte differing vlues vi rules oth opies ts=0 5 site d ts= 6 site e f ts= 6 Dt pth E.g., simple rules For site wins For ltest timestmp wins For dd inrements CS 347 Notes 8 43 CS 347 Notes 8 44
Multiple Opertionl Groups Summr Dt pth oth opies ts=0 5 site d ts= 7 site e f ts= 6 oth opies (integrted) f ts= 8 Prtitions without replition Aort, ommit quorums 3PC with quorums Prtitions with replition At most one opertionl group Updte propgtion Multiple opertionl groups CS 347 Notes 8 45 CS 347 Notes 8 46