Using the Transformation Approach to Build a Safe and Generic D

43
Using the Transformational Approach to Build a Safe and Generic Data Synchronizer Pascal Molli, Gérald Oster, Hala Skaf-Molli, Abdessamad Imine ECOO and Cassis Project Inria Lorraine

Transcript of Using the Transformation Approach to Build a Safe and Generic D

Page 1: Using the Transformation Approach to Build a Safe and Generic D

Using the Transformational Approach to Build a Safe and Generic Data Synchronizer

Pascal Molli, Gérald Oster, Hala Skaf-Molli, Abdessamad

ImineECOO and Cassis Project

Inria Lorraine

Page 2: Using the Transformation Approach to Build a Safe and Generic D

Context Mobile computing

Before disconnection : replication When reconnect : synchronization

Groupware Before insulation : replication before publishing : reconciliation

Page 3: Using the Transformation Approach to Build a Safe and Generic D

Synchronizers… File synchronizer

Unisson, IntelliSync, Microsoft Synchronizer Data Synchronizers

ActiveSync, Hotsync, I-Sync Merge tools and CM Tools

CVS, rcsmerge, Diff3, XyDiff, XmlDiff… Distributed System

CODA, Bayou, Ficus, IceCube Replicated database

Asymetric replication

Page 4: Using the Transformation Approach to Build a Safe and Generic D

Synchonization Copies are identical after

synchronization… But in which state ??

At which level of granularity ?? File system level, file content level

For which data type ?? XML, text, file system, …

Who is resolving conflict ? Synchronizer, user, admin

And when ? During synchro, after ??

Page 5: Using the Transformation Approach to Build a Safe and Generic D
Page 6: Using the Transformation Approach to Build a Safe and Generic D

Safety… At least, convergence… Not true for a lot of actual

synchronizer Propagate non conflictual update and

delegate the others to users Synchronizers stops with errors in

case of conflicts

Page 7: Using the Transformation Approach to Build a Safe and Generic D

Synchronizing All copies are identical after

synchronization Synchronizers have to solve

conflicts that occurs during synchronization…

A critical application… Has to be safe…

Page 8: Using the Transformation Approach to Build a Safe and Generic D
Page 9: Using the Transformation Approach to Build a Safe and Generic D

tata

>>> add >>> Thu Jan 01 00:00:00 CET 1970 : :

>>>> add >>> Mon Nov 10 00:00:00 CET 2003 : localhost.users.momo54:c51e0b4fa9fe407401df27be35416c45

>>zidane

>>abdou

>====== Mon Nov 10 15:02:18 CET 2003 : localhost.users.momo54:c520825fa9fe4074005ddc65434fbba3

>>melchior

>>balthazar

><<< add <<<

====== Thu Jan 01 00:59:59 CET 1970 : :

>>>> add >>> Mon Nov 10 00:00:00 CET 2003 : localhost.users.momo54:c51e0b4fa9fe407401df27be35416c45

>>zidane

>>abdou

>====== Mon Nov 10 15:02:35 CET 2003 : localhost.users.momo54:c52307b7a9fe4074007525ad12ae999b

>>riri

>>fifi

>>loulou

><<< add <<<

<<< add <<<

Page 10: Using the Transformation Approach to Build a Safe and Generic D

Objectives Define a correctness criteria for

synchronization (safety) Provide an unique algorithm for

synchronizing any kind of data (genericity)

Prove correctness of our new synchronizer

Page 11: Using the Transformation Approach to Build a Safe and Generic D

Problems Safety

Ensure convergence in all cases... Without loosing data…

Genericity/Granularity Reconcile at all level of granularity

for any kind of data…

Page 12: Using the Transformation Approach to Build a Safe and Generic D

Idea Transformational Approach with

real-time editors… A real-time Synchronizer:

Replication of data… Data can diverge due to network

latency (650ms)

Page 13: Using the Transformation Approach to Build a Safe and Generic D

Transformational approach Consistency defined!

convergence, causality, intention preservation

Safety… Integration algorithm is

independant from data type Granularity/Genericity

Real Time Editor/Synchronizer : Just the value of the delay

Page 14: Using the Transformation Approach to Build a Safe and Generic D

Operational Transformation n sites each site has a copy of shared

data One operation:

generated and executed on one site broadcasted to other sites received by other sites re-executed on other sites

Page 15: Using the Transformation Approach to Build a Safe and Generic D

efect

effect

efect

efects

Ins(5,s)Ins(2,f)

effecst effects

Ins(5,s) Ins(2,f)

Op1 Op2

S1 o Op1

State S1 State S1

Page 16: Using the Transformation Approach to Build a Safe and Generic D

efect

effect

efect

efects

Ins(5,s)Ins(2,f)

effects effects

Ins(6,s) Ins(2,f)

T(Ins(5,s),Ins(2,f))=

Ins(6,s)

Op1 Op2

Op’2

Site 1 : user 1 Site 2 : user 2

State S1

S1 o Op1

State S1

Page 17: Using the Transformation Approach to Build a Safe and Generic D
Page 18: Using the Transformation Approach to Build a Safe and Generic D

Correctness of transformation function Algorithms (Goto,SOCT2,3,4,

Adopted…) ensure CCI if… …Transformation functions ensure

at Least :

Page 19: Using the Transformation Approach to Build a Safe and Generic D

What we did… Rewrite SOCT4 algorithm for

synchronization needs Develop transformation functions

for the file system and text files… Others data type can be

integrated…

Page 20: Using the Transformation Approach to Build a Safe and Generic D

The SOCT4 Algorithm

• transposing forward opi with local operations• transposing forward local operations with opi’• putting opi at the right place

- backward transposition unnecessary- state vectors no needed

Beforeintegration

local operationswaiting for broadcast

opi-1

opi

op1

op2

. . . . . . . .

opL

opL m1

Afterintegration

Integrationof opi

☛ Sequential reception + Differed broadcast

opi

opop

iop

op1

op2

. . .. . . . .

opL

opL

opi-1

opim1

’ ’forward transposed

local operations

op1 m

op2

. . . . . . . .

opL

opL 1

opi’op

i-1

opi

Page 21: Using the Transformation Approach to Build a Safe and Generic D
Page 22: Using the Transformation Approach to Build a Safe and Generic D

Synchronization example

Page 23: Using the Transformation Approach to Build a Safe and Generic D

Logs after reconciliation (S3) Site1 Site2

Page 24: Using the Transformation Approach to Build a Safe and Generic D

A channel with 3 workspaces

Page 25: Using the Transformation Approach to Build a Safe and Generic D

T(opl1,op3)=opl’1T(op3,opl1)=op’3

Opl’1 opl2Op’3 T(opl2,op’3)=opl’2T(op’3,opl2)=op’’3

Opl’1 Opl’2 Op’’3

Site « Hala », Ns=2, Synchronize !

Execute(op’’3)Ns=Ns+1, getOp ?No more remote op

Send(opl’1)Send(opl’2)

opl1 opl2

Log[0]=opl1,log[1]=opl2,

op3getOp(Ns+1)=op3

Page 26: Using the Transformation Approach to Build a Safe and Generic D

What we have done now… Write transformation functions for

file system and text file content In case of conflict -> authorize

compensation… (no lost operation) Prove C1 on transformation

function Specified it in first order logic Use the SPIKE automatic theorem

prover to automatically prove it [ECSCW03]

Page 27: Using the Transformation Approach to Build a Safe and Generic D
Page 28: Using the Transformation Approach to Build a Safe and Generic D

riri

fifi

>>> add >>> Sun Nov 09 00:00:00 CET 2003 : localhost.users.momo54:c03328027f0000010152997671df9f2d

>melchior

>balthazar

====== Sun Nov 09 18:34:11 CET 2003 : localhost.users.momo54:c03251f47f000001012803bab735f091

>zidane

>abdou

<<< add <<<

loulou

Page 29: Using the Transformation Approach to Build a Safe and Generic D
Page 30: Using the Transformation Approach to Build a Safe and Generic D

Example for file system/ /

mf(1,0,a) md(1,0,a)

//a

//a

mf(1,0,a#1)

//a

/a#1

md(1,0,a);mv(1,0,a,1,0,a#1)

//a

/a#1

op1 op2

Page 31: Using the Transformation Approach to Build a Safe and Generic D

Example: état initial

Dir:0

a

1:gaspardmelchiorbalthazar

c

Page 32: Using the Transformation Approach to Build a Safe and Generic D

Scenario

synchronize

synchronize

synchronize

synchronize

synchronize

Ab(b,0,zidane)Db(b,2, melchior, balthazar)

Ab(a,3,abdou)Mf(b)Mv(/a,/b)

U3U2U1

Page 33: Using the Transformation Approach to Build a Safe and Generic D

État final

Dir:0

b1

1:gaspard>>melchiorbalthazar=abdou<<

2:

zidane

b c

Page 34: Using the Transformation Approach to Build a Safe and Generic D

http://www.libresource.org

Page 35: Using the Transformation Approach to Build a Safe and Generic D

Conclusion One synchronizer for all data types Convergence is achieved in all

cases It relies on a formal framework Transformation functions are

proven An original way to use the

tansformational approach

Page 36: Using the Transformation Approach to Build a Safe and Generic D
Page 37: Using the Transformation Approach to Build a Safe and Generic D

Commit Client...

Page 38: Using the Transformation Approach to Build a Safe and Generic D

Update Client...

Page 39: Using the Transformation Approach to Build a Safe and Generic D
Page 40: Using the Transformation Approach to Build a Safe and Generic D

Perspectives:Synchronization networks

Page 41: Using the Transformation Approach to Build a Safe and Generic D

Example scenario

Page 42: Using the Transformation Approach to Build a Safe and Generic D

Renaming for resolving conflicts How to compute new unique

name ?? Mf(id,pid,name,)

mf(1,0,a,{a}) md(2,0,b,{a,b}) mf(3,2,a,{a})

Max(s)+id is unique

Page 43: Using the Transformation Approach to Build a Safe and Generic D

File System Representation

mf(1,0,a) md(2,0,b) mf(3,2,a)

mv(2,4,b,0,c)