gritzko / swarm-ron-docs

https://gritzko.gitbooks.io/swarm-the-protocol/content/
54 stars 8 forks source link

LWW, snapshots and order #4

Closed vestild closed 7 years ago

vestild commented 7 years ago

Snaposhot of Object (and may be other LWW types) conflicts with delayed ops because it remove ops stamps, but LWW require it to select winner.

For example op A with stamp 123 and value X that reduced to snapshot. It not explicit written, but i think snapshot op must have same stamp as max op stamp. But in can be op B with stamp 321. So we have snapshot ~ with stamp 321 and value {"A":"X", "B":"some"} Then replica receives delayed op A with stamp 124 and value Y. Or op A with stamp 122 and value Y. "reordering of concurrent ops does not affect the resulting state" So result A value must depends on second op stamp. But it depends on snapshot logic and stamp.

I think not all types can have snapshots. For LWW types we can have only compaction by removing old ops, it require nearly same space as a snapshot (difference is just op specifiers). Or we can say that peer will reject all ops with stamp older then x, and compact ops elder then x to snapshot.