Malachi.Cluster.ClusterFlagsMachine (malachi v0.22.7)

View Source

A ra (Raft) state machine that replicates Malachi.Cluster.ClusterFlags, the cluster's operator-enabled feature flags.

apply/3 delegates to the pure, deterministic ClusterFlags.apply/2, so the flags become Raft-replicated with no logic in the machine itself, exactly the shape of Malachi.Cluster.RingMachine and Malachi.Cluster.LeaseMachine. Like the ring it needs no clock: switching a flag on is a set insert.

Versioned through Malachi.Cluster.MachineVersion, which is also what keeps a member running a build from before this store existed from ever being told to enable a flag: {:enable_flag, 2} was introduced at machine version 2, so it is refused identically on every member until the last one runs a build that supports 2.