Skip to content

Record original error code to operation_errors metric for temporary errors #1664

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 18, 2024

Conversation

amacaskill
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:
When CreateVolume is executed, the csi provisioner expects either "final" or "temporary" errors. If we report final error when disk creation could be ongoing or the disk is already created, then a PVC deletion before successful volume creation could lead to disk leakage as DeleteVolume won't happen.

To prevent disk leakage in PDCSI driver, we changed the error codes returned from GetDisk, InsertDisk, waitForZonalOp / waitForRegionalOp inside of CreateVolume to return the Unavailable / Aborted temporary error code (see PR). The consequence of this most of the interesting errors we get from CreateVolume, all return Unavailable error code, which is filtered out from SLO. This PR reports the original error code (returned by GetDisk, InsertDisk, waitForZonalOp / waitForRegionalOp) to the operation_errors metric, but continues to return the "temporary" errors (Unavailable/Aborted) to the csi provisioner.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Record original error code for temporary errors for kubernetes.io/master/pdcsi/csidriver_operation_errors metric.

@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 8, 2024
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 8, 2024
@amacaskill amacaskill force-pushed the temporary-slo-fix branch 5 times, most recently from ad9eaa4 to e0054fd Compare April 10, 2024 17:12
@amacaskill amacaskill changed the title Record original error code for temporary errors Record original error code to operation_errors metric for temporary errors Apr 10, 2024
@amacaskill amacaskill force-pushed the temporary-slo-fix branch 3 times, most recently from da86cad to c28f572 Compare April 10, 2024 18:42
@amacaskill
Copy link
Member Author

/assign @leiyiz

Copy link
Contributor

@leiyiz leiyiz left a comment

Choose a reason for hiding this comment

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

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: amacaskill, leiyiz

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

@amacaskill
Copy link
Member Author

/hold adding the test case Leiyi suggested.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 16, 2024
@amacaskill
Copy link
Member Author

/hold cancel
Added the test case.

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 16, 2024
Copy link
Contributor

@leiyiz leiyiz left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added 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 Apr 16, 2024
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 16, 2024
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 16, 2024
@amacaskill
Copy link
Member Author

/retest

2 similar comments
@amacaskill
Copy link
Member Author

/retest

@amacaskill
Copy link
Member Author

/retest

@amacaskill amacaskill force-pushed the temporary-slo-fix branch 2 times, most recently from 9b6fda8 to ce6dea1 Compare April 17, 2024 19:30
@amacaskill
Copy link
Member Author

/retest

Copy link
Contributor

@leiyiz leiyiz left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 18, 2024
@k8s-ci-robot k8s-ci-robot merged commit 28591b6 into kubernetes-sigs:master Apr 18, 2024
7 checks passed
@amacaskill
Copy link
Member Author

/cherry-pick release-1.13

@k8s-infra-cherrypick-robot

@amacaskill: new pull request created: #1672

In response to this:

/cherry-pick release-1.13

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.

@hime
Copy link
Member

hime commented Sep 25, 2024

/cherry-pick release-1.12

@k8s-infra-cherrypick-robot

@hime: #1664 failed to apply on top of branch "release-1.12":

Applying: Record original error code to operation_errors metric for temporary errors
Using index info to reconstruct a base tree...
M	pkg/common/utils_test.go
M	pkg/gce-cloud-provider/compute/gce-compute.go
M	pkg/gce-pd-csi-driver/controller.go
M	pkg/metrics/metrics.go
M	pkg/metrics/metrics_test.go
Falling back to patching base and 3-way merge...
Auto-merging pkg/metrics/metrics_test.go
CONFLICT (content): Merge conflict in pkg/metrics/metrics_test.go
Auto-merging pkg/metrics/metrics.go
CONFLICT (content): Merge conflict in pkg/metrics/metrics.go
Auto-merging pkg/gce-pd-csi-driver/controller.go
Auto-merging pkg/gce-cloud-provider/compute/gce-compute.go
Auto-merging pkg/common/utils_test.go
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Record original error code to operation_errors metric for temporary errors
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-1.12

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.

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. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

5 participants