docs: design the general member-rollout mechanism for mutable settings - #350
docs: design the general member-rollout mechanism for mutable settings#350Timofei Larkin (lllamnyp) wants to merge 1 commit into
Conversation
EtcdCluster has exactly one setting that changes a running cluster: spec.replicas. The rest is either CEL-locked to delete-and-recreate or accepted and applied to nothing — snapshotSpecIntoObserved copies eight fields into status.observed, members mirror them only at creation, and reconciliationComplete never inspects member content. Editing spec.resources therefore settles to Progressing=False/Reconciled having changed no member, with no signal that anything was ignored. Propose a rollout engine: compare each member structurally against the template derived from status.observed, roll outdated members one at a time branching on storage medium (PVC restart vs memory-backed replacement via learner add and catch-up promotion), and gate each step on cluster-level health rather than Pod readiness. Changes contribute ordered passes, each completed across all members before the next begins, which is what makes a CA rotation expressible without a cluster-wide outage. Also proposes a single chokepoint for member disruption, so the one-at-a-time invariant is structural rather than a convention every future code path has to remember. Classifies every spec field as rollable or genuinely locked, and leaves five decisions open — update strategy, version-upgrade policy, PVC expansion scope, concurrency on larger clusters, and whether the PDB and the engine should share one encoding of the quorum arithmetic. Assisted-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
I just ran into this exact issue with a memory backed cluster. The problem with the I think the fix is to use I can think of three ways to solve this, ordered by increasing complexity/flexibility:
|
Summary
Design proposal, no code. Adds
docs/member-rollout-design.md.EtcdClusterhas exactly one setting that changes a running cluster:spec.replicas. Everything else is either CEL-locked to delete-and-recreate, or accepted by the apiserver and then applied to nothing.The second category is the part worth naming, because from the outside it looks like it worked.
snapshotSpecIntoObservedcopiesversion,storage,resources,affinity,topologySpreadConstraints,additionalMetadata,optionsandimagePullSecretsintostatus.observed; members mirror those fields only at creation; andreconciliationCompleteasks only whether the member count matches, whetherClusterIDis latched, and whether every member isReady. It never asks whether a single member reflects the values just snapshotted.So editing
spec.resourceson a live cluster snapshots intoobserved, setsProgressing=True/SpecChanged, and — because the count never changed and everyone is still Ready — immediately settles toProgressing=False/Reconciled. The CR reports it reconciled a change no member received. There is no signal to the user that anything was dropped.What the design proposes
A rollout engine that compares each member structurally against the template derived from
status.observedand rolls outdated members one at a time, branching on storage medium:EtcdMember; the tmpfs data dir died with the Pod, so this is a replacement, and the gap-fill goes in viaMemberAddAsLearnerand is promoted only after catch-up.Each step gates on cluster-level health —
MemberListshowing the expected voting members with noneIsLearner,endpoint healthon every endpoint, applied-index convergence, a linearizable read — rather than on Pod readiness, which is too weak for a member that rejoined empty.Changes contribute ordered passes, each completed across all members before the next begins. Most changes are one pass. CA rotation is two (widen trust to
concat(old, new), then swap leaves), and that structure is what makes a CA rotation expressible without a cluster-wide outage.The doc also classifies every spec field as rollable or genuinely locked, and proposes a single chokepoint for member disruption so the one-at-a-time rule is structural rather than something every future code path has to remember.
Why one-at-a-time is not negotiable
With three members quorum is two, so exactly one may be down. On a PVC cluster exceeding that costs availability; on a memory-backed cluster it costs the data, because no survivor holds it.
pdbMaxUnavailablealready encodes the arithmetic, but the PodDisruptionBudget it feeds only gates the Eviction API — the operator deletes Pods directly, so the PDB does not constrain the operator at all. Self-governance is the only protection there is, which is the argument for enforcing it in one place.Relationship to the TLS handover work
#349 is parked as a draft. Its simultaneous roll is both unnecessary (the two-pass CA sequence has no intermediate state where a pair of members cannot authenticate) and, on memory-backed clusters, unrecoverable. The parts of it that stand on their own — the CEL relaxation, the fail-closed conflict guard, the material-readiness gate, not rebuilding Pods the operator did not author — carry over onto this mechanism.
The companion research note
docs/etcd-tls-reload.mdis not included here: it cross-references a runbook section that currently exists only on the #349 branch, so committing it onto this branch would introduce a dangling link. The two should land together, or that one first.Open questions in the doc
spec.updateStrategy—RollingUpdatevsOnDelete, so disruption lands in a chosen maintenance window?storage.sizein scope here, or separate work? It is a PVC patch, not a roll.Status of the claims
Everything in the "confirmed" list is read off the code and cited with
file:line. The rollout step ordering, victim-selection preferences and health-gate composition are proposed and unvalidated — the cheap check is a scratch three-member cluster of each medium, rollingresourcesend to end before anything harder is attempted.