class

LavinMQ::Clustering::EtcdCoordinator

Inherits LavinMQ::Clustering::Coordinator < Reference < Object

Constants

Log = LavinMQ::Log.for("clustering.etcd_coordinator")

Constructors

new(config : Config, etcd : Etcd)
Source

Instance methods

campaign(advertised_uri : String, lease_id : Int) : Etcd::ElectionLeader

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.

Source
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.

Source
password

Read the cluster's shared replication secret, generating one if missing.

Source
update_isr(synced_node_ids : Set(Int32)) : Nil

Replace the ISR set wholesale with the given node ids.

Source
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.

Source