Skip to content
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

[V2] chore: DeleteVolume should wait for replicas to be fully deleted #1300

Merged
merged 2 commits into from
Jun 1, 2022

Conversation

sunpa93
Copy link
Contributor

@sunpa93 sunpa93 commented Apr 26, 2022

instead of requeuing

What type of PR is this?
/kind chore

What this PR does / why we need it:

  • AzVolume controller originally relied on reconciler requeue to wait for replica AzVolumeAttachment to be fully deleted but this can lead to huge backoffs causing a significant delay in volume deletion.
  • This PR leverages condition watcher / waiter component to have AzVolume controller wait for the replica AzVolumeAttachments to be deleted to avoid over issuance of requeue
  • And replaces existing polling in replica controller with event triggered waiter package.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

@k8s-ci-robot
Copy link
Contributor

@sunpa93: The label(s) kind/chore cannot be applied, because the repository doesn't have them.

In response to this:

instead of requeuing

What type of PR is this?
/kind chore

What this PR does / why we need it:

  • AzVolume controller originally relied on reconciler requeue to wait for replica AzVolumeAttachment to be fully deleted but this can lead to huge backoffs causing a significant delay in volume deletion.
  • This PR leverages condition watcher / waiter component to have AzVolume controller wait for the replica AzVolumeAttachments to be deleted to avoid over issuance of requeue
  • And replaces existing polling in replica controller with event triggered waiter package.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

none

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/test-infra repository.

@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 Apr 26, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @sunpa93. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Apr 26, 2022
@edreed
Copy link
Collaborator

edreed commented Apr 26, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 26, 2022
pkg/controller/common.go Outdated Show resolved Hide resolved
@sunpa93 sunpa93 force-pushed the volume-clean-up branch 4 times, most recently from e403e82 to 4396fa1 Compare April 28, 2022 21:39
@sunpa93
Copy link
Contributor Author

sunpa93 commented Apr 28, 2022

/retest

@sunpa93 sunpa93 force-pushed the volume-clean-up branch 2 times, most recently from 13edbea to 0f64ac2 Compare May 3, 2022 19:52
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2022
@sunpa93 sunpa93 force-pushed the volume-clean-up branch from 0f64ac2 to 8e983d3 Compare May 4, 2022 00:41
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 4, 2022
@edreed
Copy link
Collaborator

edreed commented May 7, 2022

/retest

1 similar comment
@edreed
Copy link
Collaborator

edreed commented May 8, 2022

/retest

@edreed
Copy link
Collaborator

edreed commented May 8, 2022

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 8, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 8, 2022
@edreed
Copy link
Collaborator

edreed commented May 9, 2022

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 9, 2022
@sunpa93 sunpa93 force-pushed the volume-clean-up branch from 8e983d3 to b7a99fc Compare May 20, 2022 17:46
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 20, 2022
@sunpa93 sunpa93 force-pushed the volume-clean-up branch from b7a99fc to 19bcb28 Compare May 20, 2022 17:52
@sunpa93
Copy link
Contributor Author

sunpa93 commented May 20, 2022

err = wait.PollImmediateWithContext(ctx, deletionPollingInterval, 10*time.Minute, func(ctx context.Context) (bool, error) {
azVolumeAttachmentList := &diskv1beta1.AzVolumeAttachmentList{}
err := r.controllerSharedState.cachedClient.List(ctx, azVolumeAttachmentList, &listOptions)
if err != nil {
if errors.IsNotFound(err) {
return true, nil
}
w.Logger().Errorf(err, "Failed to get AzVolumeAttachments.")
return false, err
}
return len(azVolumeAttachmentList.Items) == 0, nil
})

Probably can replace this polling with conditionWaiter

@sunpa93 sunpa93 force-pushed the volume-clean-up branch from 694f4b8 to cfed9a1 Compare May 20, 2022 21:59
@sunpa93 sunpa93 force-pushed the volume-clean-up branch 4 times, most recently from 81462c6 to 7490690 Compare May 25, 2022 21:05
@sunpa93 sunpa93 force-pushed the volume-clean-up branch from 7490690 to 0b10d46 Compare May 25, 2022 21:08
@sunpa93
Copy link
Contributor Author

sunpa93 commented May 26, 2022

/test pull-azuredisk-csi-driver-external-e2e-single-az-mainv2

2 similar comments
@sunpa93
Copy link
Contributor Author

sunpa93 commented May 26, 2022

/test pull-azuredisk-csi-driver-external-e2e-single-az-mainv2

@sunpa93
Copy link
Contributor Author

sunpa93 commented May 26, 2022

/test pull-azuredisk-csi-driver-external-e2e-single-az-mainv2

@edreed
Copy link
Collaborator

edreed commented Jun 1, 2022

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 1, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: edreed, sunpa93

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

The pull request process is described 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 merged commit c9f7f05 into kubernetes-sigs:main_v2 Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants