fix(controllers): extend crash-loop self-heal to memory members - #352
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughCrash-loop self-healing now applies to eligible memory-backed members as well as PVC-backed members. A regression test covers replacement when quorum remains available. Documentation describes the expanded behavior. ChangesCrash-loop recovery
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/concepts.md`:
- Around line 160-166: Document that crash-loop self-healing applies only when
EtcdMember.Spec.Bootstrap is false: qualify the trigger and replacement flow in
docs/concepts.md lines 160-166, and qualify the crash-loop replacement exception
in both storage rows at docs/concepts.md lines 130-131. Keep bootstrap members
excluded from this recovery behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 88795c74-1f40-4e63-95a9-ba3ac4d66c3f
📒 Files selected for processing (4)
controllers/etcdmember_controller.gocontrollers/etcdmember_controller_test.godocs/concepts.mddocs/operations.md
|
Hi K.J. Valencik (@kjvalencik) , thanks for your amazing work here and on #351. Could you please run |
ffe7e26 to
fe2b15e
Compare
The crash-loop self-heal (cozystack#336) excluded memory-medium members on the theory that the pod-loss self-heal already covers them. That check only fires when the Pod is gone or replaced (Status.PodUID mismatch); a memory member whose Pod is alive but whose etcd can never start keeps the same Pod UID forever and is invisible to it. The live failure mode: a replacement learner is created with --initial-cluster baked into its immutable Pod spec; if membership changes again before the learner's first successful boot, etcd fatals with "error validating peerURLs ...: member count is unequal" on every restart. With max-learners=1 the wedged learner also blocks all further member replacement, so the cluster stays degraded until a human (or a node rotation that happens to kill the Pod) intervenes. Drop the medium exclusion. Every other guard stays: non-bootstrap, etcdContainerStuck (not ready, restart threshold, not OOMKilled, Pod not terminating) and the quorum gate. Replacing a stuck memory member is strictly milder than the already-covered PVC case — its data dies with the Pod anyway. Related: cozystack#351 Signed-off-by: K.J. Valencik <kjvalencik@gmail.com>
fe2b15e to
0ecaf81
Compare
|
Done, thanks! |
24f3892
into
cozystack:main
The crash-loop self-heal (#336) excluded memory-medium members on the theory that the pod-loss self-heal already covers them. That check only fires when the Pod is gone or replaced (
Status.PodUIDmismatch); a memory member whose Pod is alive but whose etcd can never start keeps the same Pod UID forever and is invisible to it. The operator therefore left such a member crash-looping unrecovered forever.The live failure mode: a replacement learner is created with
--initial-clusterbaked into its immutable Pod spec; if membership changes again before the learner's first successful boot, etcd fatals witherror validating peerURLs ...: member count is unequalon every restart. Withmax-learners=1the wedged learner also blocks all further member replacement, so the cluster stays degraded until a human (or a node rotation that happens to kill the Pod) intervenes.Drop the medium exclusion. Every other guard stays: non-bootstrap,
etcdContainerStuck(not ready, restart threshold, not OOMKilled, Pod not terminating) and the quorum gate. Replacing a stuck memory member is strictly milder than the already-covered PVC case — its data dies with the Pod anyway.Includes a regression test (
TestUpdateStatus_ReplacesStuckMemoryMember) and doc updates indocs/concepts.md/docs/operations.md.Related: #351
Summary by CodeRabbit
Bug Fixes
Documentation