Closed yim-lee closed 3 years ago
I think I know how we'll tackle this thanks to recent CRDT Gossip Replicator work.
Notes:
[target: vv of latest known deltas]
, we always send it the deltas when we perform updatesGeneral idea... More digging soon
direct local writes therefore could perhaps then be implemented as "write the specific delta that this write has caused"
Right, I think this echoes with the original thinking as well:
Direct replication sends changes of CRDT belonging to a specific owner to other replicators in the cluster. It does NOT send the delta of local replicator's copy of the CRDT.
whenever we gossip to a target, we take as many deltas as we have stored and we know the target has not seen them yet
we can resetDelta when we hand over the delta to the gossiper I believe;
👍 I guess this means gossip sends a batch of deltas (which is the behavior we want) and not after every single delta?
👍 I guess this means gossip sends a batch of deltas (which is the behavior we want) and not after every single delta?
Yup, we get batching there :-)
We had an outstanding TODO and the topic was brought up again in https://github.com/apple/swift-distributed-actors/pull/210.
resetDelta
should be called some time after the delta CRDT has propagated its changes:LocalCommand.write
for the CRDT and direct replication completes successfully (i.e., we trust gossip to do the right thing)Some things to keep in mind:
One approach might be:
ActorOwned
CRDT toresetDelta
after successful direct replicationresetDelta
on its copy of CRDT after successful gossipMore thoughts in https://github.com/apple/swift-distributed-actors/pull/210#issuecomment-546013992