pingqiuandClaude Opus 5.5 b342e8f21f authority, master: keep a restarted primary through one bounded boot grace
A freshly started volume reports ReadyForPrimary=false until its engine
has a promotion fact, so any restart of the current primary failed over
at the first heartbeat whenever a ready peer existed (#128; T1/T2).

The controller now keeps the current primary while it is placeable and
inside its boot grace: the grace starts at the first heartbeat of a new
incarnation and lasts PrimaryBootGrace (the master sets it to its
freshness window). Only its endpoint may be refreshed meanwhile. The
grace never covers an explicit unhealthy report (unreachable,
ineligible, withdrawn); ends for good once the replica reports ready or
the grace expires (no extension by repeated not-ready heartbeats); and
is refused to a replica with PrimaryBootFlapRestarts process starts
within PrimaryBootFlapWindow (defaults 3 in 10 min). No incarnation (an
older volume binary) means no grace.

The promotion gate's direct reassign skips a current primary that is
placeable by its own report and inside its boot grace.

Lock order: grace state lives under TopologyController.mu, written only
by observeIncarnationsLocked inside the existing snapshot path; the
controller calls nothing outward while holding it. The gate calls
PrimaryInBootGrace (takes c.mu) holding no controller-visible lock, the
same direction as its existing controller calls.

Fixes #128

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 11:10:32 -08:00
Languages
Go 84.5%
Rust 7.9%
Shell 2.7%
templ 1.6%
Java 1%
Other 2%