failover

Crates.iofailover
lib.rsfailover
version0.1.2
sourcesrc
created_at2022-11-24 22:32:08.58466
updated_at2023-03-08 12:38:56.746059
descriptionfailover based on etcd
homepage
repository
max_upload_size
id722443
size75,565
Vladimir (0xdeafbeef)

documentation

README

failover

etcd-based consensus for [hot spare

Algorithm

Lease part

  1. Client asks etcd for an initial lease for N seconds and receives a lease id.
  2. The lease is renewed every N/2 seconds.
  3. If connection is lost then client uses the same lease id to renew the lease.

NOTE: It's ½64 chance that the lease ID is reused.

Election part

  1. Client starts a campaign with a random timeout. If election expires then there is another leader. Client asks etcd for the leader lease id and waits until it dies.
  2. Client polls etcd every lease lifetime seconds. If etcd returns -1 then leader is dead, goto 1.
Commit count: 0

cargo fmt