Skip to main content

Module message

Module message 

Source
Expand description

Wire message types for kevy-elect’s control plane.

All messages travel as RESP2 multi-bulk arrays (same format as the kevy keyspace plane), so encode/decode reuses kevy-resp’s borrowed parser. See docs/protocol.md for the wire shape per variant and the state machine that consumes them.

Verbs (UPPERCASE bulk strings on the wire) — uniform with kevy’s existing command shape:

  • HB <epoch> <node_id> <role> <repl_offset>
  • OFFER <new_epoch> <candidate_id> <repl_offset>
  • ACCEPT <epoch> <accepter_id>
  • ANNOUNCE <epoch> <new_primary_id> <new_primary_addr>

The numeric fields (epoch, offset) ride as RESP bulk-string decimals — same convention as kevy-replicate’s REPLICATE FROM <offset> ID <replica_id> handshake. Keeps every frame text-friendly for tcpdump / strace debugging.

Enums§

Message
One decoded message off the control wire. The four variants mirror the four verbs in the protocol spec.
Role
Self-perceived role of a node in its heartbeat. The state machine in kevy-elect’s reactor decides which transitions are legal; this enum is just what gets put on the wire.