fix: validate restore volume binding lifecycle - #10765
Conversation
|
Auto Cherry-pick Instructions CLA Recheck Instructions |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #10765 +/- ##
==========================================
+ Coverage 64.56% 64.79% +0.22%
==========================================
Files 521 506 -15
Lines 63343 63558 +215
==========================================
+ Hits 40897 41181 +284
+ Misses 18804 18723 -81
- Partials 3642 3654 +12
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Superseded by four independent draft PRs so each lifecycle hardening can be reviewed and merged separately:\n\n1. #10779 — wait for Kubernetes formal PVC binding\n2. #10777 — protect Cluster restore execution with a dedicated finalizer and ordered deletion\n3. #10776 — split successful helper release from deleting-PVC cleanup\n4. #10778 — add minimum restored-PV rebind validation\n\nAll four target main, reference #10755, and carry the nopick label. |
What changed
dataprotection.kubeblocks.io/populate-fromdataSourceRefsemantics: the normal workload Pod may driveWaitForFirstConsumernode selection, but the target PVC remains unbound (and the Pod Pending) until prepareData completes and the restored PV is handed to the target PVCspec.volumeNameWhy
A target PVC can be bound before the VolumePopulator restore finishes. Treating any non-empty
spec.volumeNameas restore completion could delete the helper PVC and restore Job. Binding a target PVC before population also violates thedataSourceRefcontract: Bound must mean that the volume is ready for the consuming Pod.Cross-object informer updates can also expose the new target PVC before the updated PV ClaimRef/annotation. That observation is now retried while the helper PVC still proves that the rebind is in flight.
Impact
Invalid early bindings are surfaced through the Restore condition without deleting or replacing existing PVC/PV resources. A provisioner that binds an empty target volume while a custom
dataSourceRefis still being populated is not treated as a supported restore path. InstanceSet, Component, and Cluster workload semantics are unchanged.Validation
make manifestsandmake lint(0 issues)Fixes #10755