Skip to content

modify: support rollback #513

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft

Conversation

huww98
Copy link
Contributor

@huww98 huww98 commented Jul 20, 2025

What type of PR is this?

/kind feature

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespaces from that line:

/kind api-change
/kind bug
/kind cleanup
/kind design
/kind documentation
/kind failing-test
/kind feature
/kind flake

What this PR does / why we need it:

Support rollback to VAC A if modifying from A to B failed with a final error.
This works just like we modifying it again to C on final error.

The significant changes in the sync logic:

  • Always retry if pvc.Status.ModifyVolumeStatus is not nil, which means the
    last transation does not finish successfully.
  • Treat empty VAC name like refering to an special VAC with empty parameters,
    to support the use case of rolling back from non-nil VAC name to nil. We only
    allow this when no modify has been successfully applied, to avoid by-passing
    the quota system.
flow chart

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

The first 4 commits are already included in my other PRs. Please review the last commit. I will rebase when the previous PRs are merged.

Does this PR introduce a user-facing change?:

Support rolling back when modify failed

huww98 added 4 commits July 19, 2025 12:26
`defer ctx.Done()` does not actually cancel the context.
So it will be clear which VAC the status is describing.

Specifically, we now set target for Pending status to indicate which VAC we are waiting for.
Also fix the test. Previous test does not actually cover the relevant code path.
fix wrong error is used when checking final error.

map is not safe work read/write concurrently from multiple worker. Also fixed that.

Added related tests.
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Jul 20, 2025
@k8s-ci-robot k8s-ci-robot requested review from humblec and jingxu97 July 20, 2025 09:23
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: huww98
Once this PR has been reviewed and has the lgtm label, please assign msau42 for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jul 20, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @huww98. Thanks for your PR.

I'm waiting for a kubernetes-csi member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jul 20, 2025
Support rollback to VAC A if modifying from A to B failed with a final error.
This works just like we modifying it again to C on final error.

The significant changes in the sync logic:
- Always retry if pvc.Status.ModifyVolumeStatus is not nil, which means the
  last transation does not finish successfully.
- Treat empty VAC name like refering to an special VAC with empty parameters,
  to support the use case of rolling back from non-nil VAC name to nil. We only
  allow this when no modify has been successfully applied, to avoid by-passing
  the quota system.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants