Skip to main content

Module join

Module join 

Source
Expand description

Join path: contact seeds, receive full cluster state, apply locally.

The join loop is deliberately robust against two realistic cluster startup failure modes:

  1. Slow start: the designated bootstrapper has not yet completed its first Raft election when this node first calls join(). Every seed may return “unreachable” or “not leader” for a brief window. We retry the whole loop with exponential backoff so the join eventually succeeds without operator intervention.

  2. Leader redirect: the seed we contacted is alive but isn’t the group-0 leader. It returns JoinResponse { success: false, error: "not leader; retry at <addr>" } and we follow the hint up to a small number of hops before falling through to the next seed. The string format is the contract set by raft_loop::join::join_flow — keep this parser in lock-step with that producer.