c oncurrent e diting i nitial s tate r eview
play

C ONCURRENT E DITING : I NITIAL S TATE (R EVIEW ) 4 0 4 0 PC PC - PowerPoint PPT Presentation

O PERATION T RANSFORMATION Prasun Dewan Department of Computer Science University of North Carolina at Chapel Hill dewan@cs.unc.edu I MMEDIATELY D ELIVERING C ONCURRENT M ESSAGES A tree of message paths exist Create vector time stamp and


  1. A SSUME I NDEXED S EQUENCE D ATA T YPE 1 Element 1 Arbitrary element type 2 Element 2 3 Element 3 1 Lunch? String element type (message sequence) 2 Lunch? 3 No, Yes 1 2 3 4 5 char element type (text editors) l u n c h I(nsert) (index, element) Operations D(elete)( index)) 38

  2. C ONCURRENT I NORDER I NTERACTION 5 0 4 1 Assume only two sites PC PC 1 2 Assume messages are received in order from other site I,2,u No need for received buffer I,6,? Still need time stamp to discover concurrency 1 2 3 4 5 1 2 3 4 5 l u n c h l n c h ? General rule for transforming operation Received Buffer 1 Received Buffer 2 39

  3. T RANSFORMATION F UNCTION 5 0 4 1 PC PC Increment index of remote 1 2 operation if it has higher index before processing it Remote operation, R I,2,u transformed! I,6,? Based on index of concurrent local operation, L 1 2 3 4 5 1 2 3 4 5 R T = Transform (R, L) l u n c h l n c h ? Apply R T instead of R at local site Local Buffer 1 Local Buffer 2 I,2,u 5 0 I,5,? 4 1 R Transformed if R T != R 40 Need local buffer to store L rather than remote buffer

  4. C ONTROL A LGORITHM : S INGLE L OCAL C ONCURRENT O PERATION 5 0 4 1 Given Remote op R, concurrent with PC PC exactly one local op L 1 2 R T = Transform (R, L) Execute R T I,2,u I,6,? Site.TimeStamp.increment(R.site) 1 2 3 4 5 1 2 3 4 5 l u n c h l n c h ? 41

  5. OT S YSTEM C OMPONENTS Transformation function: Handles single local and concurrent operations Control algorithm: Calls transformation function, processed buffer and local time stamps Both must be correct. 42

  6. I NCLUSION T RANSFORMATION Operation Transform (Operation R, Operation L) { if (R.type == Insert && L.type == Insert) return TransformInsertInsert (R,L); else …. } Operation TransformInsertInsert (InsertOperation R, InsertOperation L) { Operation R T = R.deepCopy(); if (R.index > L.index) R T .index = R.index + 1 return R T ; } Transform includes effect of Other uses in which first and Correct? second operand on first second operands are not operand remote and local operations Correctness criterion? Called inclusion Names indicate we include effect of earlier executed transformation local operation on later received concurrent remote 43 operation

  7. C ORRECTNESS C RITERION Operation Transform (Operation R, Operation L) { ==? if (R.type == Insert && L.type == Insert) return TransformInsertInsert (R,L); else …. } Operation TransformInsertInsert (InsertOperation R, InsertOperation L) { Operation R T = R.deepCopy(); if (R.index > L.index) R T .index = R.index + 1 return R T ; } S Constraint for Transform S O 1 T(O 2 , O 1 ) S 12 == Distributed S 1 S 2 S O 2 T(O 1 , O 2 ) S 12 Merge S 12 44

  8. I NITIAL S TATE 5 4 0 0 0 5 0 0 PC PC 1 2 1 2 3 4 5 1 2 3 4 5 l u n c h l u n c h 45

  9. I NSERTION AT SAME INDEX 6 4 0 0 0 5 0 1 PC PC 1 2 I,6,? I,6,! 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,6,? 6 0 I,6,! 5 1 46

  10. I NSERTION AT SAME INDEX InsertOperation TransformInsertInsert (InsertOperation Remote, InsertOperation L ocal) { Operation Remote T = Remote.clone(); 4 6 0 0 5 0 0 1 if (Remote.index > Local.index) Remote T .index = Remote.index + 1 PC PC return Remote T ; 1 2 } I,6,? I,6,! Neither operation is I,6,? transformed I,6,! 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,6,? 6 0 I,6,! 5 1 47

  11. I NSERTION AT SAME INDEX A LGORITHM InsertOperation TransformInsertInsert (InsertOperation Remote, InsertOperation L ocal) { Operation Remote T = Remote.clone(); 4 6 1 0 0 6 0 1 if (Remote.index > Local.index) Remote T .index = Remote.index + 1 PC PC return Remote T ; 1 2 } I,6,? I,6,! Neither operation is I,6,? transformed I,6,! Inconsistency 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ! ? l u n c h ? ! Local Buffer 1 Local Buffer 2 I,6,? 6 0 I,6,! 5 1 48

  12. I NSERTION AT SAME INDEX : E RROR Operation TransformInsertInsert (InsertOperation R, InsertOperation L) { 6 4 0 0 5 0 1 0 Operation R T = R.deepCopy(); if (R.index > L.index) PC PC R T .index = R.index + 1 1 2 return R T ; } I,6,? I,6,! Constraint for Transform I,6,? S O 1 T(O 2 , O 1 ) S 12 I,6,! == S O 2 T(O 1 , O 2 ) S 12 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ! ? l u n c h ? ! Local Buffer 1 Local Buffer 2 I,6,? 6 0 I,6,! 5 1 49

  13. P RIORITY -B ASED InsertOperation TransformInsertInsert (InsertOperation R, InsertOperation L) { Operation R T = deepClone(); 6 4 0 1 0 6 1 0 if ((R.index > L.index) || (R.index === L.index && R.id < L.id)) PC PC R T .index = R.index + 1; 1 2 return R T ; } I,6,? I,6,! Constraint for Transform I,7,? S O 1 T(O 2 , O 1 ) S 12 I,6,! == S O 2 T(O 1 , O 2 ) S 12 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ! ? l u n c h ! ? Insert concurrent text at some position in order of priority Local Buffer 1 Local Buffer 2 I,6,? 6 0 I,6,! 5 1 Can two remote operations be transformed wrt to the 50 same local operation?

  14. C ONTROL A LGORITHM : S INGLE L OCAL C ONCURRENT O PERATION 5 0 4 1 Given Remote op, R, concurrent with PC PC exactly one local op L 1 2 R T = Transform (R, L) Execute R T I,2,u I,6,? Site.TimeStamp.increment(R.site) 1 2 3 4 5 1 2 3 4 5 l u n c h l n c h ? Local Buffer 1 Local Buffer 2 51

  15. M ULTIPLE T RANSFORMED R EMOTE C ONCURRENT O PERATIONS 4 4 0 0 0 4 0 0 PC PC 1 2 A remote site can execute multiple operations that are concurrent wrt to local buffer 1 2 3 4 1 2 3 4 l n c h l n c h Local Buffer 1 Local Buffer 2 52

  16. M ULTIPLE T RANSFORMED R EMOTE C ONCURRENT O PERATIONS 4 5 0 0 4 0 2 0 PC PC 1 2 I,2,u I,5,? I,6,! 1 2 3 4 5 1 2 3 4 5 6 l u n c h l n c h ? ! Local Buffer 1 Local Buffer 2 I,2,u 5 0 I,5,? 4 1 I,6,! 4 2 53

  17. S ITE 1 O PERATION A RRIVES AND IS NOT T RANSFORMED 4 5 0 0 0 5 2 0 PC PC 1 2 I,2,u I,5,? I,6,! I,2,u 1 2 3 4 5 1 2 3 4 5 6 7 l u n c h l u n c h ? ! Local Buffer 1 Local Buffer 2 I,2,u 5 0 I,5,? 4 1 I,6,! 4 2 54

  18. F IRST S ITE 2 O PERATION A RRIVES 4 5 0 0 0 5 0 2 PC PC 1 2 I,2,u I,5,? I,6,! I,2,u I,5,? 1 2 3 4 5 1 2 3 4 5 6 7 l u n c h l u n c h ? ! Local Buffer 1 Local Buffer 2 I,2,u 5 0 I,5,? 4 1 I,6,! 4 2 55

  19. F IRST O PERATION T RANSFORMED 5 4 0 1 5 0 0 2 PC PC 1 2 I,2,u I,5,? I,6,! I,2,u I,6,? 1 2 3 4 5 6 1 2 3 4 5 6 7 l u n c h ? l u n c h ? ! Local Buffer 1 Local Buffer 2 I,2,u 5 0 I,5,? 4 1 I,6,! 4 2 56

  20. S ECOND O PERATION A RRIVES Multiple remote 5 4 0 2 0 5 0 2 operations PC PC transformed with 1 2 respect to same local operation I,2,u I,5,? I,6,! I,2,u I,6,? I,6,! 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ! ? l u n c h ? ! Local Buffer 1 Local Buffer 2 I,2,u 5 0 I,5,? 4 1 I,6,! 4 2 57

  21. B UFFER C LEANUP 4 5 0 3 5 0 0 3 Multiple remote operations transformed PC PC 1 2 with respect to same local operation I,2,u I,5,? How long should local I,6,! buffer be kept? I,2,u I,6,! No need to transform I,8,? I,7,! If local.timestamp < > msg.timestamp I,8,? 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 l u n c h ? ! ? l u n c h ? ! ? Each subsequent message has larger time stamp Local Buffer 1 Local Buffer 2 Remove all locals from I,2,u 5 0 I,5,? 4 1 buffer with time stamp I,6,! 4 2 smaller than time stamp 58 of received message

  22. T RANSFORMING R EMOTE O PERATION (R EVIEW S TART ) 5 0 4 1 PC PC 1 2 I,2, u I,6, ? Sometimes semantics can be used to transform concurrent operations to 1 2 3 4 5 6 1 2 3 4 5 6 give desired result l u n c h ? l u n c h ? 59

  23. OT S YSTEM C OMPONENTS Transformation function: Handles single local and concurrent operations Control algorithm: Calls transformation function, processed buffer and local time stamps Both must be correct. 60

  24. P RIORITY -B ASED T RANSFORMATION Constraint for Transform S O 1 T(O 2 , O 1 ) S 12 == S O 2 T(O 1 , O 2 ) S 12 InsertOperation TransformInsertInsert (InsertOperation R, InsertOperation L) { Operation R T = deepClone(); if ((R.index > L.index) || (R.index === L.index && R.id < L.id)) R T .index = R.index + 1; return R T ; } 61

  25. C ONTROL A LGORITHM : S INGLE L OCAL C ONCURRENT O PERATION Given Remote op R, concurrent with exactly one local op L R T = Transform (R, L) Execute R T Site.TimeStamp.increment(R.site) 62

  26. N EED F OR L OCAL B UFFER 5 0 4 1 PC PC 1 2 I,2, u 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ? Local Buffer 1 Local Buffer 2 I,2, u 5 0 I,5, ? 4 1 63

  27. B UFFER C LEANUP (R EVIEW E ND ) 4 5 0 3 5 0 0 3 Multiple remote operations transformed PC PC 1 2 with respect to same local operation I,2, u I,5, ? How long should local I,6, ! buffer be kept? I,2, u I,6, ! No need to transform I,8, ? I,7, ! If local.timestamp < > msg.timestamp I,8,? 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 l u n c h ? ! ? l u n c h ? ! ? Each subsequent message has larger time stamp Local Buffer 1 Local Buffer 2 Remove all locals from I,2, u 5 0 I,5, ? 4 1 buffer with time stamp I,6, ! 4 2 smaller than time stamp 64 of received message

  28. D UAL : O PERATION T RANSFORMED M ULTIPLE T IMES Multiple remote 5 4 3 0 5 0 0 3 operations PC PC transformed with 1 2 respect to same local operation I,2, u I,5, ! I,6, ! Dual? I,2, u A remote operation I,6, ! I,8, ! transformed with respect to multiple I,7, ! local operations I,8, ! 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 l u n c h ? ! ? l u n c h ? ! ? Local Buffer 1 Local Buffer 2 I,2, u 5 0 I,5, ? 4 1 I,6, ! 4 2 65

  29. I NITIAL S TATE 3 4 0 0 0 3 0 0 PC PC 1 2 1 2 3 1 2 3 n c h n c h Local Buffer 1 Local Buffer 2 66

  30. M ULTIPLE C ONCURRENT L OCAL O PERATIONS WRT R EMOTE C ONFLICTING O PERATION 4 4 0 0 0 3 0 2 PC PC 1 2 I,4, ? I,1,l I,2, u 1 2 3 4 1 2 3 4 5 n c h ? l u n c h Local Buffer 1 Local Buffer 2 I,4, ? 4 0 I,1,l 3 1 I,2, u 3 2 67

  31. M ULTIPLE C ONCURRENT L OCAL O PERATIONS WRT R EMOTE C ONFLICTING O PERATION 4 4 0 0 3 0 0 2 PC PC 1 2 I,4, ? I,1,l I,2, u I,1,1 1 2 3 4 1 2 3 4 5 n c h ? l u n c h Local Buffer 1 Local Buffer 2 I,2, u 4 0 I,1,l 3 1 I,2, u 3 2 68

  32. M ULTIPLE C ONCURRENT L OCAL O PERATIONS WRT R EMOTE C ONFLICTING O PERATION 4 4 1 0 0 3 0 2 PC PC 1 2 I,4, ? I,1,l I,2, u I,1,1 1 2 3 4 5 1 2 3 4 5 l n c h ? l u n c h Local Buffer 1 Local Buffer 2 I,4, ? 4 0 I,1,l 3 1 I,2, u 3 2 69

  33. M ULTIPLE C ONCURRENT L OCAL O PERATIONS WRT R EMOTE C ONFLICTING O PERATION 4 4 0 1 0 3 0 2 PC PC 1 2 I,4, ? I,1,l I,2, u I,1,1 I,2, u 1 2 3 4 5 1 2 3 4 5 l n c h ? l u n c h Local Buffer 1 Local Buffer 2 I,4, ? 4 0 I,1,l 3 1 I,2, u 3 2 70

  34. M ULTIPLE C ONCURRENT L OCAL O PERATIONS WRT R EMOTE C ONFLICTING O PERATION 4 4 0 2 0 3 0 2 PC PC 1 2 I,4, ? I,1,l I,2, u I,1,1 I,2, u 1 2 3 4 5 6 1 2 3 4 5 l u n c h ? l u n c h Local Buffer 1 Local Buffer 2 I,4, ? 3 0 I,1,l 3 1 I,2, u 3 2 71

  35. M ULTIPLE C ONCURRENT L OCAL O PERATIONS WRT R EMOTE C ONFLICTING O PERATION 4 4 2 0 0 3 0 2 PC PC 1 2 I,4, ? I,1,l I,2, u I,4,? I,1,1 I,2, u 1 2 3 4 5 6 1 2 3 4 5 l u n c h ? l u n c h Local Buffer 1 Local Buffer 2 I,4, ? 3 0 I,1,l 3 1 I,2, u 3 2 72

  36. F IRST T RANSFORMATION Transform wrt to first 4 4 0 2 3 0 2 0 concurrent local operation PC PC 1 2 I,4, ? I,1,l I,2, u I,5,? I,1,1 I,2, u 1 2 3 4 5 6 1 2 3 4 5 l u n c h ? l u n c h Local Buffer 1 Local Buffer 2 I,4, ? 3 0 I,1,l 3 1 I,2, u 3 2 73

  37. S ECOND T RANSFORMATION /C ONTROL A LGORITHM Transform wrt to second 4 4 0 2 4 0 0 2 concurrent local operation PC PC 1 2 A remote operation transformed with respect to I,4, ? I,1,l multiple local operations I,2, u Run transform function with I,6,? respect to all concurrent I,1,1 operations in the local log: Transform (Transform I,2, u (Transform (R, L1), L2) …LN) 1 2 3 4 5 6 1 2 3 4 5 6 Control algorithm now l u n c h ? l u n c h ? handles multiple concurrent/local operations using Transform function Local Buffer 1 Local Buffer 2 addressing single concurrent I,4, ? 3 0 I,1,l 3 1 remote/local operation I,2, u 3 2 74

  38. C ONTROL A LGORITHM : S INGLE L OCAL C ONCURRENT O PERATION Given Remote op, R, concurrent with exactly one local op L R T = Transform (R, L) Execute R T Site.TimeStamp.increment(R.site) Algorithm for multiple local concurrent operations? 75

  39. C ONTROL A LGORITHM : M ULTIPLE C ONCURRENT L OCAL O PERATIONS Given Remote op, R, concurrent with local ops L 1 , L 2 , .. L N For each L R = Transform (R, L) Execute R Site.TimeStamp.increment(R.site) 76

  40. S INGLE S ITE T RANSFORMATION 4 4 2 0 0 4 2 0 PC PC All examples so far involved 1 2 transformation(s) at one site I,4, ? I,1,l I,2, u I,6,? Transformation at both sites? I,1,1 I,2, u 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ? Local Buffer 1 Local Buffer 2 I,4, ? 3 0 I,1,l 3 1 I,2, u 3 2 77

  41. I NITIAL S TATE 4 4 0 0 4 0 0 0 PC PC 1 2 1 2 3 4 1 2 3 4 u n c h u n c h Local Buffer 1 Local Buffer 2 78

  42. M ULTIPLE C ONCURRENT R EMOTE O PERATIONS 4 5 0 0 4 0 2 0 PC PC 1 2 I,5, ? I,1,l I,6, ! 1 2 3 4 5 1 2 3 4 5 6 u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 79

  43. A RRIVAL AT S ITE 1 4 5 0 0 4 0 2 0 PC PC 1 2 I,5, ? I,1,l I,6, ! I,1,l 1 2 3 4 5 1 2 3 4 5 6 u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 80

  44. R ESULT OF T RANSFORM 5 4 0 0 0 4 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,1,l 1 2 3 4 5 1 2 3 4 5 6 u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 Remote operation I,5, ? 5 0 I,1,l 4 1 not transformed I,6, ! 4 2 81

  45. U NTRANSFORMED A PPLICATION 5 4 1 0 0 4 2 0 PC PC 1 2 I,5, ? I,1,l I,6, ! I,1,l 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 82

  46. A RRIVAL AT SECOND SITE 4 5 0 1 4 0 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,5, ? I,1,l 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 83

  47. T RANSFORMED WRT TO F IRST L OCAL O PERATION 4 5 0 1 4 0 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,6, ? I,1,l 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 84

  48. E XAMINING S ECOND L OCAL O PERATION 4 5 0 1 4 0 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,6, ? I,1,l 1 2 3 4 5 6 1 2 3 4 5 6 l u n c h ? l u n c h ! Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 85

  49. S ECOND T RANSFORMATION AND A PPLICATION 4 5 1 0 0 5 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,7, ? I,1,l 1 2 3 4 5 6 1 2 3 4 5 6 7 l u n c h ? l u n c h ! ? Local Buffer 1 Local Buffer 2 User 1 < User 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 86

  50. S ECOND A RRIVAL AT S ITE 1 5 4 0 1 0 5 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,7, ? I,1,l I,6, ! 1 2 3 4 5 6 1 2 3 4 5 6 7 l u n c h ? l u n c h ! ? Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 87

  51. O PERATION T RANSFORMED 5 4 0 1 0 5 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,7, ? I,1,l I,7, ! 1 2 3 4 5 6 1 2 3 4 5 6 7 l u n c h ? l u n c h ! ? Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 88

  52. A PPLICATION OF T RANSFORMED O PERATION 5 4 0 2 0 5 0 2 PC PC 1 2 I,5, ? I,1,l I,6, ! I,7, ? I,1,l I,7, ! 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ? ! l u n c h ! ? Inconsistency! Never compared user ids at Local Buffer 1 Local Buffer 2 site 1 I,5, ? 5 0 I,1,l 4 1 What went wrong? I,6, ! 4 2 89

  53. W HAT W ENT W RONG ? 5 4 2 0 0 5 2 0 Never compared site ids at site 1 PC PC 1 2 Effect of remote I, 1, 1 on local I, 5, ? I,5, ? I,1,l not recorded I,6, ! I,7, ? Must change time stamp and if I,1,l necessary operands of local operation I,7, ! Transform gives effect of an operation on another 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ? ! l u n c h ! ? Used it so far to get effect of local operation on remote operation Local Buffer 1 Local Buffer 2 I,5, ? 5 0 I,1,l 4 1 Need to also use it to determine I,6, ! 4 2 effect of remote operation on local operation 90

  54. R UNNING T RANSFORM IN P AIRS 4 5 0 2 5 0 2 0 Transform (Insert (1, ‘l’), Insert (5, ‘?’)) PC PC 1 2 I,5, ? I,1,l Transform (Insert (5, ‘?’), Insert (1, ‘l’)) I,6, ! I,7, ? Each transformation computed at both sites ! I,1,l I,6, ! Time stamps of local operations changed 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ! ? l u n c h ! ? Local Buffer 1 Local Buffer 2 I,6, ? 5 2 I,1,l 5 2 I,6, ! 5 2 91

  55. P REVIOUS C ONTROL A LGORITHM 4 5 2 0 0 5 2 0 Given Remote op, R, concurrent PC PC with local ops L 1 , L 2 , .. LN 1 2 I,5, ? For each L I,1,l I,6, ! I,7, ? R = Transform (R, L) I,1,l Execute R I,6, ! Site.TimeStamp.increment(R.site) 1 2 3 4 5 6 7 1 2 3 4 5 6 7 l u n c h ! ? l u n c h ! ? Local Buffer 1 Local Buffer 2 I,6, ? 5 2 I,1,l 5 2 I,6, ! 5 2 92 Effects of L 1 , L 2 , .. L N included in R Effects of R must also be included in L 1 , L 2 , .. L N

  56. N EW C ONTROL A LGORITHM 4 5 2 0 0 5 2 0 Given Remote op, R, concurrent PC PC with local ops L 1 , L 2 , .. LN 1 2 I,5, ? For each L I,1,l I,6, ! I,7, ? R = Transform (R, L) I,1,l L = Transform (L, R) I,6, ! 1 2 3 4 5 6 7 1 2 3 4 5 6 7 L.TimeStamp.increment(R.site) l u n c h ! ? l u n c h ! ? Execute R Local Buffer 1 Local Buffer 2 I,6, ? 5 2 I,1,l 5 2 Site.TimeStamp.increment(R.site) I,6, ! 5 2 93 Effects of L1, L2, .. LN included in R Effects of R included in L1, L2, .. LN

  57. G EOMETRIC P ROOF O F C ORRECTNESS Site1 S Site 2 SW : process One-step process site 1 op Distributed Merge S 11 S 21 Given two sequences of concurrent ops, SE: process site transformation merge 2 op S 11,21 process can be derived S 12 Perpendiculars to two non dashed lines meet at S 12, 21 a unique point Intermediate state not reached at Multiple one-step both sites processes to reach state Without undo Local op not changed Including effect of multiple Including effect of multiple Same transformation 94 remotes on a single local at locals on a remote at site 1 computed at both sites site 2

  58. G EOMETRIC P ROOF O F C ORRECTNESS Site1 S Site 2 Given Remote op, R, concurrent SW : process with local ops L 1 , L 2 , .. LN site 1 op Distributed Merge For each L S 11 S 21 SE: process site 2 op R = Transform (R, L) S 11,21 S 12 L = Transform (L, R) S 12, 21 L.TimeStamp.increment(R.site) Execute R Site.TimeStamp.increment(R.site) Including effect of multiple Including effect of multiple 95 remotes on a single local at locals on a remote at site 1 site 2

  59. R E -R UN WITH T RANSFORMATIONS 4 4 0 0 4 0 0 0 PC PC 1 2 1 2 3 4 1 2 3 4 u n c h u n c h Local Buffer 1 Local Buffer 2 96

  60. C ONCURRENT I NTERACTION 4 5 0 0 0 4 0 2 Given Remote op, R, concurrent PC PC with local ops L 1 , L 2 , .. LN 1 2 I,5, ? For each L I,1,l I,6, ! R = Transform (R, L) L = Transform (L, R) L.TimeStamp.increment(R.site) 1 2 3 4 5 1 2 3 4 5 6 u n c h ? l u n c h ! Execute R Local Buffer 1 Local Buffer 2 Site.TimeStamp.increment(R.site) I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 97

  61. R EMOTE I, 1, L ARRIVES AT S ITE 1 4 5 0 0 0 4 0 2 Given Remote op, R, concurrent PC PC with local ops L 1 , L 2 , .. LN 1 2 I,5, ? For each L I,1,l I,6, ! R = Transform (R, L) I,1,l L = Transform (L, R) L.TimeStamp.increment(R.site) 1 2 3 4 5 1 2 3 4 5 6 u n c h ? l u n c h ! Execute R Local Buffer 1 Local Buffer 2 Site.TimeStamp.increment(R.site) I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 98

  62. R EMOTE N OT T RANSFORMED 4 5 0 0 0 4 0 2 Given Remote op, R, concurrent PC PC with local ops L 1 , L 2 , .. LN 1 2 I,5, ? For each L I,1,l I,6, ! R = Transform (R, L) I,1,l L = Transform (L, R) L.TimeStamp.increment(R.site) 1 2 3 4 5 1 2 3 4 5 6 u n c h ? l u n c h ! Execute R Local Buffer 1 Local Buffer 2 Site.TimeStamp.increment(R.site) I,5, ? 5 0 I,1,l 4 1 I,6, ! 4 2 99 Remote not transformed

  63. L OCAL T RANSFORMED 4 5 0 0 4 0 0 2 Given Remote op, R, concurrent PC PC with local ops L 1 , L 2 , .. LN 1 2 I,5, ? For each L I,1,l I,6, ! R = Transform (R, L) I,1,l L = Transform (L, R) L.TimeStamp.increment(R.site) 1 2 3 4 5 1 2 3 4 5 6 u n c h ? l u n c h ! Execute R Local Buffer 1 Local Buffer 2 Site.TimeStamp.increment(R.site) I,6, ? 5 1 I,1,l 4 1 I,6, ! 4 2 10 Local transformed 0

Recommend


More recommend