Skip to content

Simplify the node backoff logic #960

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

Merged
merged 1 commit into from
Apr 20, 2022

Conversation

saikat-royc
Copy link
Member

What type of PR is this?

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:
This PR aims to simply the node backoff logic by removing the worker based backoff queue, to a simple map which tracks the active backoff condition per node. Removing the worker, removes dual sources of controller publish/unpublish calls (one from side car, one from the queue worker), and potential out of order execution of attach/detach disks operations.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
Tested manually by running multiple cycles of attach/detach operations of 100 disks for a single pod.

Does this PR introduce a user-facing change?:

Simplify the node backoff logic

@saikat-royc saikat-royc requested a review from mattcary April 6, 2022 23:12
@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 6, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: saikat-royc

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 added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Apr 6, 2022
@saikat-royc
Copy link
Member Author

/retest

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 6, 2022
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Apr 11, 2022
@saikat-royc saikat-royc requested review from mattcary and removed request for davidz627 and saad-ali April 11, 2022 17:33
@saikat-royc saikat-royc force-pushed the 999.0-v1 branch 2 times, most recently from 3e89e05 to a274559 Compare April 14, 2022 06:57
@pwschuurman
Copy link
Contributor

LGTM

@pwschuurman
Copy link
Contributor

/lgtm

@k8s-ci-robot
Copy link
Contributor

@pwschuurman: changing LGTM is restricted to collaborators

In response to this:

/lgtm

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.

@saikat-royc saikat-royc merged commit a906163 into kubernetes-sigs:release-999.0 Apr 20, 2022
// Mark the node and rate limit all the following attach/detach
// operations for this node
gceCS.publishErrorsSeenOnNode[nodeID] = true
if gce.IsTooManyRequestError(err) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we want to back off on any error. With this logic, we'll let the attacher retry until api quota gets exhausted. I think we would rather not even reach that point.

I don't think there's a case where immediate retries are useful?

Comment on lines +521 to +522
resp, err := gceCS.executeControllerUnpublishVolume(ctx, req)
backoff := isResourceExhaustedError(err)
Copy link
Member

Choose a reason for hiding this comment

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

I agree. I think we should backoff for all errors from executeControllerUnpublishVolume, but we have also seen a customer case where executeControllerUnpublishVolume returns true: ControllerUnpublishVolume succeeded for disk. Already not attached. They still ended up with the same issue where the finalizer external-attacher/pd-csi-storage-gke-io was still set on the VA. I think the CSI attacher was the one that kept retrying because the csi-attacher logs repeated
VA csi-xx for volume projects/xx/zones/us-east4-a/disks/pvc-xx has attached status true but actual state false. Adding back to VA queue for forced reprocessing
Which made the kubecontroller manager keep trying to force detach but failing.

Copy link
Member

@amacaskill amacaskill May 13, 2022

Choose a reason for hiding this comment

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

To elaborate, in some cases,
instance, err := gceCS.CloudProvider.GetInstanceOrError(ctx, instanceZone, instanceName)
will still return the instance , but the device will not show up under devices when we call common.GetDeviceName(volKey), so then controllerUnpublishVolume returns true, but then we never called detachDisk (which I am assuming is what makes VA attached status to be false). So then the csi-attacher keeps queuing the VA. VA csi-xx has attached status true but actual state false. Adding back to VA queue for forced reprocessing

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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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.

5 participants