kevy_elect/lib.rs
1//! kevy-elect — quorum-based primary failover for kevy.
2//!
3//! The v3-cluster Phase 1.5 layer on top of the v1.18 manual
4//! `REPLICAOF` primitive. Detects a primary's death by quorum
5//! heartbeat, runs an offset-ordered election among the live
6//! replicas, promotes the winner via `REPLICAOF NO ONE`, and
7//! retargets the survivors at the new primary. Driven by an
8//! operator-declared peer list (no gossip discovery — the peer set
9//! is static for the lifetime of a cluster generation).
10//!
11//! T1.5.3 protocol spec lives in `docs/protocol.md`; T1.5.4 message
12//! types in [`mod@message`]. T1.5.6+ (heartbeat loop, DOWN detector,
13//! election machinery) land on top of those.
14#![forbid(unsafe_code)]
15#![warn(missing_docs)]
16
17pub mod elector;
18mod elector_inbound;
19pub mod message;
20#[cfg(test)]
21pub mod sim;
22pub mod transport;
23pub mod wire;
24
25pub use transport::{ElectorSnapshot, PeerAddr, Transport};
26
27#[cfg(test)]
28#[path = "elector_tests.rs"]
29mod elector_tests;
30
31pub use elector::{ElectConfig, ElectJitter, Elector, Outbound};
32pub use message::{Message, Role};
33pub use wire::{DecodeError, decode, encode};