The idea of Observed-Remove set is that a node can remove only values that it has observed. In practice, that means removal operations require ids of corresponding addition operations.
RON text:
set
Hexadecimal:
0x 0de9 e000 0000 0000
0000 0000 0000 0000
- Add:
- ref is 0
- payload is the value
- Remove:
- ref is the version being deleted
- payload is empty
-
Replica
alfa
adds string"bravo"
to the object#32+charlie
*set #32+charlie @35+alfa :0 'bravo' ;
-
Replica
delta
removes that value specifying its version*set #32+charlie @38+delta :35+alfa ;
- Chunk version is calculated as the maximum event or ref of contained ops.
- Reduced op format:
- Alive version (version that has not been removed)
- event is the version
- ref is 0
- payload is the value
- Tombstone (removed version)
- event is the original version
- ref is the event of the last removal op
- payload is the value, for the purpose of undo
- Alive version (version that has not been removed)
- The order of items doesn't matter. For reproducibility, ops should be sorted by event.
-
Empty object
*set #32+charlie @32+charlie :0 !
-
Replica
alfa
adds string"bravo"
to the object#32+charlie
*set #32+charlie @35+alfa :0 ! *set #32+charlie @35+alfa :0 'bravo' ,
the same with compression
*set #32+charlie @35+alfa :0 ! 'bravo' ,
-
Replica
echo
adds string"bravo"
, too*set #32+charlie @72+echo :0 ! *set #32+charlie @72+echo :0 'bravo' ,
the same with compression
*set #32+charlie @72+echo :0 ! 'bravo' ,
-
Replicas
alfa
andecho
exchange their ops (or states) and both got the same result value:*set #32+charlie @72+echo :0 ! *set #32+charlie @35+alfa :0 'bravo' , *set #32+charlie @72+echo :0 'bravo' ,
the same with compression
*set #32+charlie @72+echo :0 ! @35+alfa 'bravo' , @72+echo 'bravo' ,
-
Replica
delta
got value from the replicaalfa
, but no from the replicaecho
. Thendelta
removes the string by its version known to it.*set #32+charlie @38+delta :35+alfa ; *set #32+charlie @38+delta :0 ! @35+alfa :38+delta 'bravo' ,
-
When all replicas recieve all changes, the value at all replicas will be
*set #32+charlie @7200000001+echo :0 ! @35+alfa :38+delta 'bravo' , @72+echo :0 'bravo' ,
The same as the value encoding.
- For each item version in a value or patch there must be exactly one op with corresponding event.
- Removal has precedence over addition. For the same item version, the op with the maximum ref is chosen.