Skip to content

Conversation

@cjc7373
Copy link
Contributor

@cjc7373 cjc7373 commented Nov 20, 2025

fixes #9841

Because of the missing ownerRefernece, its controller does not get the event when the pvc gets deleted.

@cjc7373 cjc7373 requested a review from a team as a code owner November 20, 2025 08:16
@cjc7373 cjc7373 added the pick-1.0 Auto cherry-pick to release-1.0 when PR merged label Nov 20, 2025
@apecloud-bot
Copy link
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.0

@github-actions github-actions bot added the size/XS Denotes a PR that changes 0-9 lines. label Nov 20, 2025
@codecov
Copy link

codecov bot commented Nov 20, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.54%. Comparing base (67b7428) to head (dcdbfba).
⚠️ Report is 29 commits behind head on main.

Files with missing lines Patch % Lines
...oller/instanceset/reconciler_instance_alignment.go 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9882      +/-   ##
==========================================
+ Coverage   50.77%   52.54%   +1.77%     
==========================================
  Files         541      543       +2     
  Lines       58733    60784    +2051     
==========================================
+ Hits        29820    31940    +2120     
+ Misses      25967    25855     -112     
- Partials     2946     2989      +43     
Flag Coverage Δ
unittests 52.54% <66.66%> (+1.77%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

pvcObj := copyAndMerge(oldPvc, pvc)
if pvcObj != nil {
// pvc can be created by restore controller, restore controller reference for it
if err := controllerutil.SetControllerReference(its, pvcObj, model.GetScheme()); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot implicitly take over the PVC's controller Reference at the implementation level, unless there is a clear interface in the API indicating it's allowed.

A hacking behavior is even less acceptable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For example, consider a scenario where this PVC is created and managed by the user. What would happen then?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We cannot implicitly take over the PVC's controller Reference

We can't. If the PVC already has a controller reference, SetControllerReference returns an error. Maybe we can simply ignore this error. Or we can fallback to set an owner reference to it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no instanceset at the time of restore phase, we cannot create ownerReference. Can we add an annotation on PVC to indicate that it can be taken over by instanceSet?

@github-actions github-actions bot added size/L Denotes a PR that changes 100-499 lines. and removed size/XS Denotes a PR that changes 0-9 lines. labels Dec 30, 2025
@apecloud-bot apecloud-bot added the approved PR Approved Test label Dec 30, 2025
@cjc7373
Copy link
Contributor Author

cjc7373 commented Dec 30, 2025

This PR is a temporary solution. Further API discussion will happen in #9974

@cjc7373 cjc7373 merged commit 8217833 into main Dec 30, 2025
41 checks passed
@cjc7373 cjc7373 deleted the bugfix/issue-9841 branch December 30, 2025 09:38
@github-actions github-actions bot added this to the Release 0.9.6 milestone Dec 30, 2025
@apecloud-bot
Copy link
Collaborator

/cherry-pick release-1.0

@apecloud-bot
Copy link
Collaborator

🤖 says: cherry pick action finished successfully 🎉!
See: https://github.com/apecloud/kubeblocks/actions/runs/20593555351

apecloud-bot pushed a commit that referenced this pull request Dec 30, 2025
Co-authored-by: Leon <[email protected]>
(cherry picked from commit 8217833)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR Approved Test pick-1.0 Auto cherry-pick to release-1.0 when PR merged size/L Denotes a PR that changes 100-499 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] backup restore cluster delete hang

6 participants