LavinMQ::Clustering::EtcdCoordinator
Inherits LavinMQ::Clustering::Coordinator < Reference < Object
Constants
Log = LavinMQ::Log.for("clustering.etcd_coordinator")
Constructors
new(config : Config, etcd : Etcd)
SourceInstance methods
Campaign for leadership and capture the won election as the fencing token in one step, so a node can never campaign without arming the coordinator (which would make every later update_isr raise StaleLeadership). Blocks until this node is elected. Returns the won ElectionLeader.
isr
The current in-sync replica set, or nil if none has been recorded yet (a fresh cluster). Decodes the same format update_isr writes.
Replace the ISR set wholesale with the given node ids.
watch_isr
Yield the parsed ISR set on every change to the ISR key (nil when the key is deleted), until the block breaks. Used by the Controller to wait for this node to (re)appear in the ISR before serving as leader.