Protect CHK recreate with live Raft quorum safety - #2070
Conversation
4c78e49 to
44f3a37
Compare
Capturing shouldWaitHostReady before force-restart avoids Started-only after ReadyReplicas drops to 0, which let 3→1 downscale complete while the survivor was still 0/1. Co-authored-by: Cursor <cursoragent@cursor.com>
Replace abort-on-quorum-refuse with a wait-then-defer flow, recovery-first host ordering, and a CHI-style single late disrupt gate with an early ensemble snapshot. Add test_020003_3 for interrupted Keeper rolls. Co-authored-by: Cursor <cursoragent@cursor.com>
Use atomic.Int32 for the ready-count stub shared between the wait loop and the goroutine that simulates a peer recovering. Co-authored-by: Cursor <cursoragent@cursor.com>
7a1fa9c to
41cae72
Compare
Move ensemble policy into worker-raft-safety, collapse the disrupt gate behind ensureQuorumSafeToDisruptHost, and requeue ErrCRUDDeferred after 5s instead of error backoff so Raft headroom waits stay intentional. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Reviewed this in depth — the direction is right and BLOCKER 1 — a 2-node ensemble can never be rolled again
The arithmetic is right — you genuinely cannot take a node out of a 2-node Raft ensemble and keep majority. The problem is the policy: every host defers, This lands on existing 2-replica CHKs the moment the operator is upgraded — no spec change needed. The old code rolled through and converged. There's no force flag, no bounded give-up, no terminal state; the CR sits in Same shape for N=3 when one replica is permanently unrecoverable for an external reason (PV bound to a dead node, deleted PVC): the two survivors are pinned to the old spec forever. Needs an escape hatch — a defer budget that converts to Abort, or treating BLOCKER 2 — the 2-minute wait cannot observe what it is waiting for
So during the poll loop, peers' Ready state is frozen at reconcile-start values — the wait can never see a peer recover, which is the only thing that would make it proceed. It always burns the full budget and then defers.
Fix: re-Get peers inside HIGH —
|
Summary
Fixes #2069 (CHK Raft quorum safety during rolls) and #2035 (drop pointless same-size settle delay). Partial #2059 (propagate reconcile status persist errors).
Quorum-safe Keeper rolls (#2069)
On a multi-node CHK, the operator must not take a Ready replica down if that would leave the ensemble below Raft majority, and must not keep rolling the next replica while a previous one never rejoined.
Behavior:
ReadyReplicas→0) cannot flip the pass into bootstrap mid-flight.[RaftQuorumUnsafe]), continue other replicas, then soft-requeue in 5s (not error backoff).Out of scope here: committed Raft membership /
mntrbarriers (#2041 — hook only), staged rescale (e.g. 3→2→1), and replacing blind downscale sleeps with per-step settle.Settle delay and status (#2035 / partial #2059)
Completedis persisted.vs CHI shard safety (#1704)
Test plan
go test ./pkg/controller/chk/test_020005xfail removedtest_020003/test_020005(keeper upgrade / scale)test_020003_3— 3-node CHK, broken-image roll stops on one replica, peers stay Ready through operator restart, recovery to good image (CHItest_010083analogue)Follow-ups