Malachi. Cluster. RingMachine
(malachi v0.22.7)
View Source
A ra (Raft) state machine that replicates Malachi.Cluster.Ring, the cluster's durable routing
topology.
apply/3 delegates to the pure, deterministic Ring.apply/2, so the ring becomes Raft-replicated
with no logic in the machine itself, exactly the shape of Malachi.Cluster.MetadataMachine and
Malachi.Cluster.LeaseMachine. Unlike the lease machine it needs no clock: the ring's guards are
compare-and-set on version and fence, both carried in the command.
Versioned through Malachi.Cluster.MachineVersion, which also keeps an unknown command from
raising here: Ring.apply/2 has no catch-all clause.