-
Notifications
You must be signed in to change notification settings - Fork 807
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
Node Publish Mount Idempotent #1019
Conversation
Hi @nirmalaagash. 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 Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test |
/test pull-aws-ebs-csi-driver-verify |
pkg/driver/node.go
Outdated
//Checking if the path exists and error is related to Corrupted Mount, in that case, the system could unmount and mount. | ||
_, pathErr := mountutils.PathExists(target) | ||
if pathErr != nil && mountutils.IsCorruptedMnt(pathErr) { | ||
klog.V(4).Infof("Target path %q is a corrupted directory", target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are we not returning an error if target path is a corrupted directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Chances are that the device mounted or the mount point is corrupted because of improper unmounting. Hence in the next phase we try to read the directory and unmount it.
pkg/driver/node.go
Outdated
} | ||
|
||
if !notMnt { | ||
//Return error when any of the directory inside is not readable which means that a device could be mounted. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you clarify what this comment means? not sure i'm following
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a device is already mounted in the target directory, the directories inside the directory would not be accessible until the device is unmounted from the target directory. Hence in that case, it would return an error.
are all the new code paths (i.e. the if/else conditions) covered by the existing unit tests? i feel like we probably want to add a couple new ones, right? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for working on this, @nirmalaagash.
Does your fix also work block volumes? It seems we're only covering filesystem volumes.
@bertinatto Yes. This PR only covers the filesystem volumes. |
pkg/driver/node.go
Outdated
2. false, nil when the path is already mounted with a device. | ||
3. true, nil when the path is not mounted with any device. | ||
*/ | ||
notMnt, err := d.mounter.IsLikelyNotMountPoint(target) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An easy way to cover block devices as well is to move the check right below the in flight check.
You may want to take a look at the solutions both GCP PD and Azure Disk implemented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bertinatto Thanks. New commit covering block devices is pushed.
/sig storage |
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nirmalaagash, vdhanan 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 |
/retest |
1 similar comment
/retest |
The verify job fails on
New //go:build tag is added. For some reason it is using [email protected]. See similar issue kubernetes-sigs/controller-tools#594. |
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
@nirmalaagash , aca3620 looks good. This is also how k/k handled it - see https://github.com/kubernetes/kubernetes/pull/103692/files. PS: you have to fix the author of commit aca3620. |
@nirmalaagash , there is still commit aca3620 with wrong author. I think you can drop this commit from your change as there is already 77cc317. |
/check-cla |
ping @bertinatto @vdhanan |
/lgtm |
Hi folks 👋, ls it possible to backport this fix to the supported version? Thanks in advance |
…019-origin-release-1.2 [release-1.2] Automated cherry pick of #1019: Added Mount Idempotency
…019-origin-release-1.1 [release-1.1] Automated cherry pick of #1019: Added Mount Idempotency
Is this a bug fix or adding new feature?
Issue Fix #955 - Node publish mount idempotent
Issue Fix #1007 - Duplicate Mount Entries.
What is this PR about? / Why do we need it?
The PR adds mount idempotent to the CSI driver which provides multiple requests of 'NodePublishVolume' with the same request parameters would not throw error. We need it for the idempotency in mount.
What testing is done?
Unit testing.
Manual testing is done using csc tool. Below are the screenshots which shows the NodePublishVolume call of same request made multiple times. At first, it publishes the volume at the target and later request provides the information that the target is already mounted.
For the issue #1007, manual testing results.
For filesystem volume,
For block volumes,