Harden terminal-Pod replacement: cap the retry loop and backfill Status.PodUID
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go, kubernetes
- Lĩnh vực
- infrastructure
Hướng nghiên cứu
Start in the EtcdMember controller's terminal-Pod branch, the one that deletes a Pod in Succeeded/Failed and writes MemberReady=False, and read TestPodInTerminalPhase and TestReconcile_MemoryMemberStablePodIsNotLost to see how the suite drives it. Item 2 is a small change: set member.Status.PodUID from the Pod when it is empty, inside the existing Status().Update. Item 3 needs a new reconcile test with a Running Pod asserting the UID survives. Item 1 (a retry cap or minimum interval) is a design decision that the issue leaves open, so it should be settled with maintainers before any code.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Background
#370 gave the EtcdMember controller a new self-heal path: when a member's Pod reaches a terminal phase (Succeeded/Failed), the controller writes MemberReady=False, deletes the Pod, and lets the next reconcile recreate it (PVC-backed) or replace the member (memory-backed). That fixed #368 — a whole-cluster node reboot used to leave every etcd Pod terminal and the cluster down until the Pods were deleted by hand.
The path is correct as merged. Three follow-ups would harden it; none of them were worth blocking #370 on.
1. The replacement path has no cap and no backoff
The terminal-Pod branch has neither a counter (compare dataLossRestartThreshold = 5 on the crash-loop path) nor a rate limit. A Pod that lands in Failed deterministically — repeated admission failure (UnexpectedAdmissionError, OutOfcpu) or repeated eviction under node memory pressure — produces an unbounded create → Failed → delete → create loop at roughly the requeue cadence, one loop per affected member, minting a new Pod object each turn.
It never escalates to the existing etcdContainerStuck path either, because each replacement resets the container's RestartCount to zero.
This threatens neither quorum nor data: the PVC and the member ID are preserved, so etcd sees a restart rather than a membership change. The cost is churn against the apiserver plus a member that never comes up — still much better than the permanent wedge #370 fixed, which is why this is a follow-up and not a revert.
Worth considering: stamp the last replacement time in EtcdMember.Status and require a minimum interval between replacements, or count consecutive terminal replacements and fall through to the existing member-replace path once the count says the Pod will never start.
Note that the quorum gate should stay off this path. Replacement is non-destructive for PVC-backed members, and gating it on quorum would make the exact incident #368 describes — every member terminal at once — unrecoverable, since quorum is gone precisely when every member needs replacing.
2. Backfill Status.PodUID before deleting a terminal Pod
The memory-backed branch of the fix depends on Status.PodUID being non-empty: the Pod-loss gate (member.Spec.Storage.Medium == StorageMediumMemory && member.Status.PodUID != "") is what turns the deleted Pod into a member replacement rather than a fresh Pod on an empty tmpfs under the old member identity. The terminal-Pod branch deliberately avoids ensurePodAbsent for exactly this reason, since that helper clears the UID.
updateStatus records PodUID on every pass in which the Pod object exists, regardless of readiness, so for the UID to still be empty the Pod would have to reach a terminal phase within roughly one reconcile of being created — meaning it never became an etcd member, so there is no identity to return under and no data to lose. The window is real but benign; it degenerates into item 1 rather than into data loss.
Closing it is a one-liner, and the branch already performs a Status().Update, so it costs nothing: set member.Status.PodUID = string(pod.UID) when it is empty, inside that same update. Worth doing so the memory path stops depending on when status was last persisted.
3. Missing Reconcile-level negative test for a Running Pod
TestPodInTerminalPhase covers the phase predicate, and the rest of the suite passing unchanged is indirect evidence that a live Pod is untouched, but there is no reconcile test that asserts it directly. TestReconcile_MemoryMemberStablePodIsNotLost is the closest fit and uses an empty-string phase rather than an explicit PodRunning, so it does not exercise the new branch against a genuinely running Pod.
A reconcile pass over a Running Pod asserting the Pod object survives with its original UID would pin the guarantee explicitly.
- Ngôn ngữ chính
- Go
- Star
- 154
- Fork
- 31
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của cozystack/etcd-operator
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
cozystack/etcd-operator#385 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
cozystack/etcd-operator#383 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
cozystack/etcd-operator#381 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
cozystack/etcd-operator#374 · 1 bình luận ·
-
Adoption deletes the legacy cluster-state ConfigMap but leaves Pods referencing it, and neither self-heal path detects the resultCó thể đã có người làm @androndo đã nhận 46 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
cozystack/etcd-operator#373 ·
Tất cả issue của cozystack/etcd-operator
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Correct local module testing instructions for Go sample contributorsCó thể đã có người làm @slievrly đã nhận hôm nay. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
internal/core: cleanAttachmentName splits a rune at the 255-byte cap and stores invalid UTF-8Có thể đã có người làm @pacwestnobody đã nhận hôm nay. Đang mởgo good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Podiom/Podiom#427 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
TestLaunchGolden spends about 98 seconds on fake-agent exit delays under -raceCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày
-
factory:subtask
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
Maintainer thường phản hồi trong vòng 1 ngày