From bae3cb2f69c75a7972abbf1f50cbf497a475e9f4 Mon Sep 17 00:00:00 2001 From: pingqiu Date: Wed, 10 Jun 2026 17:11:50 -0700 Subject: [PATCH] phase39: gate clean delete finalizer release --- .../ops/operator_status_controller_test.go | 17 +++++++++++++++++ seaweed-block/internal/docs/current-plan.md | 19 ++++++++++++------- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/seaweed-block/core/ops/operator_status_controller_test.go b/seaweed-block/core/ops/operator_status_controller_test.go index 9389d54a27..cd5398a2c6 100644 --- a/seaweed-block/core/ops/operator_status_controller_test.go +++ b/seaweed-block/core/ops/operator_status_controller_test.go @@ -661,6 +661,23 @@ func TestOperatorStatusReconcilerReleasesFinalizerOnlyWhenReleasable(t *testing. if events.countByReason(ReasonDeleteFinalizerReleased) != 1 { t.Fatalf("missing finalizer released event: %+v", events.events) } + result, err = (OperatorStatusReconciler{ + Namespace: "kube-system", + ClusterName: "sw-block", + Source: source, + Writer: writer, + EventSink: events, + Finalizers: finalizers, + }).Reconcile(context.Background()) + if err != nil { + t.Fatalf("second reconcile: %v", err) + } + if result.FinalizerPatchCount != 0 { + t.Fatalf("second reconcile finalizer patches=%d", result.FinalizerPatchCount) + } + if events.countByReason(ReasonDeleteFinalizerReleased) != 1 { + t.Fatalf("duplicate finalizer release event: %+v", events.events) + } } func TestOperatorStatusReconcilerHoldsFinalizerWhenDeleteSafetyBlocked(t *testing.T) { diff --git a/seaweed-block/internal/docs/current-plan.md b/seaweed-block/internal/docs/current-plan.md index 86c3c81d29..572be6621e 100644 --- a/seaweed-block/internal/docs/current-plan.md +++ b/seaweed-block/internal/docs/current-plan.md @@ -1,6 +1,6 @@ # Current Plan: Phase 39 - Finalizer / Delete Safety -Status: active, 56% complete. Started on 2026-06-10. +Status: active, 70% complete. Started on 2026-06-10. Branch: `phase33-testops-failure-hardening` @@ -154,15 +154,15 @@ live CRD delete attempt if lab is available Goal: prove deletion completes only when cleanup evidence is clean. -Status: pending. +Status: component-complete; QA/live validation pending. Acceptance: ```text -[ ] deleting SwBlockVolume with clean evidence removes finalizer +[x] deleting SwBlockVolume with clean evidence removes finalizer [ ] object deletion completes -[ ] final status/event records release decision before deletion when possible -[ ] repeated reconcile is idempotent +[x] final status/event records release decision before deletion when possible +[x] repeated reconcile is idempotent [ ] final cleanup verifier returns cleanup_status=ok ``` @@ -252,6 +252,11 @@ QA strict rerun from clean lab the SwBlockVolume finalizer, writes blocked delete-safety status, emits no release event, and never calls the finalizer release path. Live delete-attempt validation remains for QA. +- 70%: D5 component gate complete. A releasable delete-safety decision + (`decision=allowed`, `state=releasable`, `finalizerReleaseAllowed=true`) + removes the SwBlockVolume finalizer, emits one release event, and is + idempotent on repeated reconcile. Live object deletion completion and final + cleanup verifier remain for QA. ## Prerequisites / Risks @@ -264,5 +269,5 @@ QA strict rerun from clean lab ## Next Step -Start D5: prove clean delete-safety evidence releases the finalizer and keeps -cleanup residue at zero, then hand D4/D5 to QA for live validation. +Prepare the D4/D5 QA assignment for live blocked-delete and clean-delete +validation, including final cleanup verification and `tp01` lab-health caveat.