Skip to content

Conversation

@jsafrane
Copy link

@jsafrane jsafrane commented Aug 19, 2020

In 4.5, NFS driver pod used 'clientaddr=<pod ip>' as a mount option. When such pod restarts, it gets a different IP address and volumes mounted by the old pod are basically broken - all operations (stat, umount, ...) will just hang forever.

Therefore:

  1. Do not use IsLikelyNotMountPoint - it runs stat() on the volume, which could hang forever. Read /etc/mounts via mounter.List() instead

  2. Use umount -f to forcefully remove NFS mount.

Carry at least for whole OCP 4.6, where we need to support upgrade from 4.5.

cc @openshift/storage @Fedosin @tombarron

In 4.5, NFS driver pod used 'clientaddr=<pod ip>' as a mount option.
When such pod restarts, it gets a different IP address and volumes mounted
by the old pod are basically broken - all operations (stat, umount) will
just hang forever.

Therefore:

1. Do not use IsLikelyNotMountPoint - it runs stat() on the volume, which
could hang forever. Read /etc/mounts instead.

2. Use "umount -f" to forcefully remove NFS mount.

Carry at least for whole OCP 4.6, where we need to support move from 4.5.
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Aug 19, 2020
@openshift-ci-robot
Copy link

@jsafrane: This pull request references Bugzilla bug 1867152, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

Bug 1867152: : Umount volumes with force

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.

@openshift-ci-robot
Copy link

@jsafrane: This pull request references Bugzilla bug 1867152, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.6.0) matches configured target release for branch (4.6.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)
Details

In response to this:

Bug 1867152: : Umount volumes with force

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.


for _, mnt := range mtab {
// This is how a directory deleted on the NFS server looks like
deletedDir := fmt.Sprintf("%s\\040(deleted)", mnt.Path)
Copy link
Member

Choose a reason for hiding this comment

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

When pod's IP address changes - does this "deleted" text appears in mount table? what happens if NFS server is unavailable?

Copy link
Author

Choose a reason for hiding this comment

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

This text appears when the mounted directory is deleted on the NFS server. It indicates a stale NFS handle.

It's copied from in-tree code, https://github.com/kubernetes/kubernetes/blob/449810c7858cc84e98ff0c859f863a40b56710dc/vendor/k8s.io/utils/mount/mount_helper_unix.go#L155

Copy link

@tombarron tombarron left a comment

Choose a reason for hiding this comment

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

Unless the in-tree driver suggests a more subtle approach then using this approach until we're confident that the are no more mounts using the pod address rather than the node address makes sense to me.

@jsafrane
Copy link
Author

Reworked to try unmount for 1 minute and then use umount -f.
Intentionally ignoring context from the caller, as it may be shorter than 1 minute. Caller gets its own timeout and the operator can still progress.

@gnufied
Copy link
Member

gnufied commented Sep 9, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 9, 2020
Copy link

@Fedosin Fedosin left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

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

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

The pull request process is described here

Details 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

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 9, 2020
@openshift-merge-robot openshift-merge-robot merged commit 95f76aa into openshift:master Sep 9, 2020
@openshift-ci-robot
Copy link

@jsafrane: All pull requests linked via external trackers have merged:

Bugzilla bug 1867152 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1867152: : Umount volumes with force

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.

mdbooth added a commit to mdbooth/csi-driver-nfs that referenced this pull request Apr 28, 2021
* pkg/nfs/nodeserver.go
    Significant manual merging due to conflicts with downstream
    commit 59fe400: openshift#31
@mdbooth mdbooth mentioned this pull request Apr 28, 2021
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. bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants