composablesys / collabs

Collabs library monorepo

Home Page:https://collabs.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

runLocally issues

mweidner037 opened this issue · comments

runLocally provides optimization opportunities, and is necessary for the revised SemidirectProduct, but is also potentially dangerous. This issue records specific things that could go wrong.

  • CMountPoint: timestamps may be causally in the past for ancestors of the mount point. Also, weird things may happen if the ancestors try to modify these messages.
  • Will ImplicitMerging map work with runLocally, given that it makes some assumptions about not having nested calls? Should likewise check for DeletingMutCSet, Semidirect. In general, we need a way to guarantee that runLocally at least works if you use it to do ops on your descendants (make sure your ancestors are okay with it, no matter what they are). Should probably make a rule that runLocally should only be used on your own descendants.
  • Also set isLocalEcho on RunLocally messages? (See ref to this issue in DeletingMutCSet.) Then breaks guarantee that it's true iff sender == replicaId, and makes checking it important for RunLocally-compatible CRDT. And/or, add MessageMeta field.
  • Permit nested calls (may need to store metas in a stack instead of just using [[runLocallyMeta]])?
  • Should getAddedContext reply to NEXT_MESSAGE_META queries?
  • Clarify which classes can't be used inside runLocally, because they do their own local echos and ban nested receive calls (BatchingLayer, CRDTExtraMetaLayer). Or, modify those classes so they do permit nested receive calls.
  • If you are sending a message and your recipients might runLocally in response, you need to request any CRDTMeta that they might consult (e.g. in PrimitiveCRDT). Easiest way is to requestAll() (inefficient), although I suppose requestAutomatic() should work most of the time.
  • For SerializableMessage guarantee to hold (original, non-serialized, from iff isLocalEcho), need to turn on isLocalEcho in runLocally, as we’ve noted previously.
  • Also set isLocalEcho on RunLocally messages? (See ref to this issue in DeletingMutCSet.) Then breaks guarantee that it's true iff sender == replicaId, and makes checking it important for RunLocally-compatible CRDT. And/or, add MessageMeta field.

Resolved: isEcho and isLocal are split into separate fields; RunLocallyLayer sets the former but not the latter, and DeletingMutCSet checks for isEcho.

I've moved runLocally into the "experimental" folder for now and don't plan to work on these.