Skip to content

fix(dataprotection): protect the cluster restore lifecycle - #10845

Merged
leon-ape merged 4 commits into
mainfrom
bugfix/10755-cluster-restore-lifecycle
Sep 4, 2026
Merged

fix(dataprotection): protect the cluster restore lifecycle#10845
leon-ape merged 4 commits into
mainfrom
bugfix/10755-cluster-restore-lifecycle

Conversation

@leon-ape

@leon-ape leon-ape commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Problem

Cluster deletion can race PVC-scoped restore startup and cleanup. The lifecycle needs one continuous protection protocol while preserving resource ownership.

Changes

  • add a Cluster restore lifecycle controller that owns only the Cluster protection finalizer
  • validate the PVC to workload to Component to Cluster owner chain before restore work starts
  • atomically register verified Cluster/Component identity with target PVC protection
  • wait for Cluster protection before creating helper or Restore resources
  • terminate Cluster restores through their resource owners in Restore, helper, target-finalizer order
  • protect and hand off postReady Restore creation without an unprotected cache window
  • roll back unused registration and use optimistic locking for concurrent finalizer changes
  • keep target PVC deletion neutral and leave Component deletion out of scope

The implementation exposes Cluster-scoped orchestration only; no nullable Component scope or legacy UID-less adoption is included.

Tests

  • Cluster finalizer lifecycle and exact UID filtering
  • registration and A-to-B staged upgrade
  • startup and postReady protection ordering
  • ordered Cluster termination, Retain, missing parent, and foreign resource rejection
  • full dataprotection suite, cmd compilation, manifests, and lint

Built on #10844, now merged into main.
Refs #10755.

Split from #10777.

@leon-ape leon-ape added the nopick Not auto cherry-pick when PR merged label Sep 4, 2026
Base automatically changed from bugfix/10755-restore-dependency-routing to main September 4, 2026 04:10
@github-actions github-actions Bot added the size/XXL Denotes a PR that changes 1000+ lines. label Sep 4, 2026
…restore-lifecycle

# Conflicts:
#	controllers/dataprotection/volumepopulator_controller.go
@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.96520% with 151 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.91%. Comparing base (63373ca) to head (b839747).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...llers/dataprotection/volumepopulator_controller.go 58.93% 95 Missing and 36 partials ⚠️
...llers/dataprotection/cluster_restore_controller.go 82.14% 13 Missing and 7 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10845      +/-   ##
==========================================
+ Coverage   65.76%   65.91%   +0.14%     
==========================================
  Files         510      511       +1     
  Lines       64958    65414     +456     
==========================================
+ Hits        42721    43117     +396     
- Misses      18449    18491      +42     
- Partials     3788     3806      +18     
Flag Coverage Δ
unittests 65.91% <64.96%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@leon-ape

leon-ape commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Sep 4, 2026
@leon-ape
leon-ape merged commit f954f3b into main Sep 4, 2026
35 checks passed
@leon-ape
leon-ape deleted the bugfix/10755-cluster-restore-lifecycle branch September 4, 2026 07:44
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test nopick Not auto cherry-pick when PR merged size/XXL Denotes a PR that changes 1000+ lines.

Projects

None yet

2 participants