Skip to content

fix(dataprotection): wait for Kubernetes PVC binding before restore completion - #10779

Merged
leon-ape merged 4 commits into
mainfrom
bugfix/10755-wait-pvc-bind-completed
Aug 14, 2026
Merged

fix(dataprotection): wait for Kubernetes PVC binding before restore completion#10779
leon-ape merged 4 commits into
mainfrom
bugfix/10755-wait-pvc-bind-completed

Conversation

@leon-ape

@leon-ape leon-ape commented Aug 13, 2026

Copy link
Copy Markdown
Collaborator

Part 1 of 4 for #10755.

Problem

VolumePopulator used spec.volumeName != "" as the restore-complete signal. That is weaker than the binding contract consumed by Kubernetes scheduling and can release restore resources before the PV controller has completed the binding.

Changes

  • wait for both spec.volumeName and pv.kubernetes.io/bind-completed before the first successful release
  • apply the binding gate only to the unreleased lifecycle transition so failed and already released PVC states remain idempotent
  • use the same binding-complete predicate for serial prepareData and postReady gates
  • keep helper resources and Restore=Unknown while formal binding is pending
  • preserve the existing PVC Bound status synchronization unchanged; its removal is isolated in chore(dataprotection): leave PVC bound status to Kubernetes #10780

Scope

This PR consumes the Kubernetes binding-complete signal. Restored-PV ClaimRef and populate-from provenance validation is intentionally isolated in #10778. This PR does not add provisioner compatibility handling, Cluster finalizers, cleanup-path refactoring, or change PVC status ownership.

Tests

  • full controllers/dataprotection suite (156 Ginkgo specs plus unit tests)
  • focused binding-complete, failed-terminal, released-reentry, serial, and postReady tests

Fixes #10755

@leon-ape leon-ape added the nopick Not auto cherry-pick when PR merged label Aug 13, 2026
@apecloud-bot

Copy link
Copy Markdown
Collaborator

Auto Cherry-pick Instructions

Usage:
  - /nopick: Not auto cherry-pick when PR merged.
  - /pick: release-x.x [release-x.x]: Auto cherry-pick to the specified branch when PR merged.

Example:
  - /nopick
  - /pick release-1.1

CLA Recheck Instructions

Usage:
  - /recheck-cla: Trigger a re-check of CLA status for this pull request.
Example:
  - /recheck-cla

@github-actions github-actions Bot added the size/L Denotes a PR that changes 100-499 lines. label Aug 13, 2026
@codecov

codecov Bot commented Aug 13, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.85714% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 64.93%. Comparing base (3ebf861) to head (b9b7b50).

Files with missing lines Patch % Lines
...llers/dataprotection/volumepopulator_controller.go 92.85% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10779      +/-   ##
==========================================
+ Coverage   64.85%   64.93%   +0.08%     
==========================================
  Files         506      506              
  Lines       63316    63323       +7     
==========================================
+ Hits        41062    41121      +59     
+ Misses      18611    18572      -39     
+ Partials     3643     3630      -13     
Flag Coverage Δ
unittests 64.93% <92.85%> (+0.08%) ⬆️

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 changed the title fix: wait for Kubernetes PVC binding before restore completion fix(dataprotection): wait for Kubernetes PVC binding before restore completion Aug 13, 2026
@leon-ape
leon-ape marked this pull request as ready for review August 13, 2026 10:01
@leon-ape
leon-ape requested review from a team, ldming and wangyelei as code owners August 13, 2026 10:01
@github-actions github-actions Bot added size/M Denotes a PR that changes 30-99 lines. and removed size/L Denotes a PR that changes 100-499 lines. labels Aug 13, 2026
@leon-ape
leon-ape marked this pull request as draft August 13, 2026 14:26
@github-actions github-actions Bot added size/L Denotes a PR that changes 100-499 lines. and removed size/M Denotes a PR that changes 30-99 lines. labels Aug 14, 2026
@leon-ape
leon-ape marked this pull request as ready for review August 14, 2026 02:32
@leon-ape

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Aug 14, 2026
@leon-ape
leon-ape marked this pull request as draft August 14, 2026 02:37
@leon-ape
leon-ape marked this pull request as ready for review August 14, 2026 02:42
@apecloud-bot apecloud-bot removed the approved PR Approved Test label Aug 14, 2026
@leon-ape

Copy link
Copy Markdown
Collaborator Author

/approve

@apecloud-bot apecloud-bot added the approved PR Approved Test label Aug 14, 2026
@leon-ape
leon-ape merged commit 7ae474d into main Aug 14, 2026
36 checks passed
@leon-ape
leon-ape deleted the bugfix/10755-wait-pvc-bind-completed branch August 14, 2026 03:00
@github-actions github-actions Bot added this to the Release 1.2.0 milestone Aug 14, 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/L Denotes a PR that changes 100-499 lines.

Projects

None yet

2 participants