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

Avoid RbdDiskManager's DetachDisk function never be executed again #79940

Conversation

@jeremyxu2010
Copy link
Contributor

commented Jul 9, 2019

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:
rbd volume will stuck when DetachDisk failed as Unmount will always returen not mounted, see #54214

Which issue(s) this PR fixes:

Fixes #54214

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

Welcome @jeremyxu2010!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

Hi @jeremyxu2010. Thanks for your PR.

I'm waiting for a kubernetes 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.

@jeremyxu2010

This comment has been minimized.

Copy link
Contributor Author

commented Jul 9, 2019

/assign @jsafrane

@jsafrane

This comment has been minimized.

Copy link
Member

commented Jul 12, 2019

rbd volume will stuck when DetachDisk failed as Unmount will always returen not mounted, see #54214

When first DetachDisk fails, the second UnmountDevice will see that the volume is unmounted and continue with DetachDisk, but now DetachDisk gets empty devicePath, which I believe fails immediately:

if len(device) == 0 {
return fmt.Errorf("DetachDisk failed , device is empty")
}

The device won't be un-mapped.

There is an effort to fix it properly in #71403. You can perhaps resume that PR and fix the remaining issue(s) there.

@jeremyxu2010 jeremyxu2010 force-pushed the jeremyxu2010:avoid_detachdisk_never_execute_again branch from f87c731 to 840dbc2 Jul 12, 2019

@jeremyxu2010

This comment has been minimized.

Copy link
Contributor Author

commented Jul 12, 2019

rbd volume will stuck when DetachDisk failed as Unmount will always returen not mounted, see #54214

When first DetachDisk fails, the second UnmountDevice will see that the volume is unmounted and continue with DetachDisk, but now DetachDisk gets empty devicePath, which I believe fails immediately:

if len(device) == 0 {
return fmt.Errorf("DetachDisk failed , device is empty")
}

The device won't be un-mapped.

There is an effort to fix it properly in #71403. You can perhaps resume that PR and fix the remaining issue(s) there.

all right, I merged code from that PR #71403, and fixed code as @cofyc suggested.

@jeremyxu2010 jeremyxu2010 force-pushed the jeremyxu2010:avoid_detachdisk_never_execute_again branch from 840dbc2 to a91eed4 Jul 12, 2019

@k8s-ci-robot k8s-ci-robot added size/M and removed size/S labels Jul 12, 2019

@jsafrane

This comment has been minimized.

Copy link
Member

commented Jul 15, 2019

/ok-to-test

/assign @cofyc
I don't understand Ceph RBD enough, I can comment only on the code style.

@jeremyxu2010 jeremyxu2010 force-pushed the jeremyxu2010:avoid_detachdisk_never_execute_again branch from a91eed4 to 1ab208b Jul 16, 2019

@jeremyxu2010

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2019

fix code format error, /retest

@jeremyxu2010 jeremyxu2010 force-pushed the jeremyxu2010:avoid_detachdisk_never_execute_again branch 2 times, most recently from e2d7b17 to f14653a Jul 16, 2019

@jeremyxu2010

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2019

rebase to the current master, /retest

@@ -789,3 +795,15 @@ func (util *RBDUtil) rbdStatus(b *rbdMounter) (bool, string, error) {
return false, output, nil
}
}

// getRbdImageInfo try to get RbdImageInfo from deviceMountPath.
func getRbdImageInfo(deviceMountPath string) (*RbdImageInfo, error) {

This comment has been minimized.

Copy link
@cofyc

cofyc Jul 16, 2019

Member

use lower case (do not export types), or return two plain variables.

This comment has been minimized.

Copy link
@jeremyxu2010

jeremyxu2010 Jul 16, 2019

Author Contributor

ok, done as you suggested

@cofyc

This comment has been minimized.

Copy link
Member

commented Jul 16, 2019

Thanks for picking this up! LGTM, I've only one minor nit.

@jeremyxu2010 jeremyxu2010 force-pushed the jeremyxu2010:avoid_detachdisk_never_execute_again branch 2 times, most recently from d0c127e to cb8adb0 Jul 16, 2019

@cofyc

This comment has been minimized.

Copy link
Member

commented Jul 16, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jul 16, 2019

@jeremyxu2010 jeremyxu2010 force-pushed the jeremyxu2010:avoid_detachdisk_never_execute_again branch from cb8adb0 to d8fc137 Jul 16, 2019

@k8s-ci-robot k8s-ci-robot removed the lgtm label Jul 16, 2019

@jeremyxu2010

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2019

rebase to the current master, /retest

@cofyc

This comment has been minimized.

Copy link
Member

commented Jul 16, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Jul 16, 2019

@jeremyxu2010

This comment has been minimized.

Copy link
Contributor Author

commented Jul 16, 2019

/retest

@jsafrane

This comment has been minimized.

Copy link
Member

commented Jul 16, 2019

/approve

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Jul 16, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jeremyxu2010, jsafrane

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 30c9f09 into kubernetes:master Jul 16, 2019

23 checks passed

cla/linuxfoundation jeremyxu2010 authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-iscsi Skipped.
pull-kubernetes-e2e-gce-iscsi-serial Skipped.
pull-kubernetes-e2e-gce-storage-slow Job succeeded.
Details
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

@jeremyxu2010 jeremyxu2010 deleted the jeremyxu2010:avoid_detachdisk_never_execute_again branch Jul 20, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.