Skip to content

refactor: improve join/update instance with cas

Егор Ивков requested to merge remove-persist-peer-rpc into master

Closes #298 (closed)

The second stage of PersistPeer removal. Initially PersistPeer was replaced with DML, now this DML is send trough CAS. This allowed:

  1. For topology not to be pre-modified on peer addition/update (now there should be no inconsistency problems)
  2. Consequently for topology to almost become a light wrapper around storage (only replicaset info is stored in topology as it is costly to recalculate)
  3. Consequently update, join and expel rpcs do not need to be called on leader (redirection to leader will be done through CAS mechanism)

There are several TODOs that are out of the scope of this mr and are left for followups:

  1. Better cas error handling - right now cas errors when returned over network are just plain strings, but we need them to be Rust types to handle them properly
  2. Found potential bug with usage of sync mutex inside of async fn
  3. Better timeout handling, depends on functions being async, which in turn requires refactor of wait_* functions.
Edited by Егор Ивков

Merge request reports