Skip to main content

Crate kevy_elect

Crate kevy_elect 

Source
Expand description

kevy-elect — quorum-based primary failover for kevy.

The v3-cluster Phase 1.5 layer on top of the v1.18 manual REPLICAOF primitive. Detects a primary’s death by quorum heartbeat, runs an offset-ordered election among the live replicas, promotes the winner via REPLICAOF NO ONE, and retargets the survivors at the new primary. Driven by an operator-declared peer list (no gossip discovery — the peer set is static for the lifetime of a cluster generation).

T1.5.3 protocol spec lives in docs/protocol.md; T1.5.4 message types in message. T1.5.6+ (heartbeat loop, DOWN detector, election machinery) land on top of those.

Re-exports§

pub use transport::ElectorSnapshot;
pub use transport::PeerAddr;
pub use transport::Transport;
pub use elector::ElectConfig;
pub use elector::ElectJitter;
pub use elector::Elector;
pub use elector::Outbound;
pub use message::Message;
pub use message::Role;
pub use wire::DecodeError;
pub use wire::decode;
pub use wire::encode;

Modules§

elector
kevy-elect core state machine — pure logic, no I/O. The TCP transport (T1.5.6 network half) drives this struct by feeding it ticks and inbound messages and consuming the returned outbound messages.
message
Wire message types for kevy-elect’s control plane.
transport
TCP control-plane transport for crate::Elector — the network half of T1.5.6. Drives the elector by reading inbound frames off one accept-side listener + writing outbound frames over one persistent connection per peer.
wire
Wire encode + decode for crate::Message. Uses kevy-resp’s RESP2 multi-bulk array shape, identical to the keyspace plane — tcpdump-friendly text frames, single decoder path workspace-wide.