-
Notifications
You must be signed in to change notification settings - Fork 560
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
rbd NodeUnpublishVolume: does not detach #86
Comments
do you see what is the other mountpoint when cnt > 0? |
Huamin Chen <[email protected]> writes:
`if cnt != 0` then there is another mount point for this rbd device
and mostly likely used by other pods.
What can lead to this situation, and what is the plan to recover from
this if it happens?
In such case, we cannot detach
the device (that'll cause data loss). Only when the last mount point
removed, we can safely detach it.
do you see what is the other mountpoint when cnt > 0?
There is none. "mount | grep rbd" shows nothing and "lsblk" also
confirms that the device isn't mounted.
|
can you add a debug message around here to print out the target path and device when there is a refcount? |
is that just an e2e problem or do you see the same issue on manual test? i couldn't reproduce it on my test locally |
Huamin Chen <[email protected]> writes:
is that just an e2e problem or do you see the same issue on manual
test? i couldn't reproduce it on my test locally
Yes. See the note in the description. That was manual, but wasn't a
problem when using only a single node. Have you ensured that the pods
get to run on different nodes?
|
mountpoint |
Here's the debug output from
It's basically the same mount, just appearing under different paths inside the container because both ceph-csi/deploy/rbd/kubernetes/csi-rbdplugin.yaml Lines 65 to 72 in e761d69
I'm still not sure whether it works for you. Have you tried this on a multi-node cluster and then used the same PV first on one node, then on another? I think this confusion is a result of doing the attach and mount both inside |
how did you run your kubelet? inside a container? |
i only have one mountpoint. can you show your output using the following cmd?
|
in any case, the code is buggy to me as the following: mounterthe mounter shouldn't be a blindly kubelet starts up in a more robust way as the following mounter := mount.New(s.ExperimentalMounterPath)
var pluginRunner = exec.New()
if s.Containerized {
glog.V(2).Info("Running kubelet in containerized mode")
ne, err := nsenter.NewNsenter(nsenter.DefaultHostRootFsPath, exec.New())
if err != nil {
return nil, err
}
mounter = mount.NewNsenterMounter(s.RootDirectory, ne)
// an exec interface which can use nsenter for flex plugin calls
pluginRunner = nsenter.NewNsenterExecutor(nsenter.DefaultHostRootFsPath, exec.New())
} host paththe host path should be bind mounted to container's |
Huamin Chen <[email protected]> writes:
how did you run your kubelet? inside a container?
No, inside a VM. The cluster itself gets brought up with kubeadm.
|
Huamin Chen <[email protected]> writes:
i only have one mountpoint. can you show your output using the following cmd?
```
# kubectl exec -ti csi-rbdplugin-4xpl7 -c csi-rbdplugin -- sh -c "grep rbd0 /proc/1/mountinfo"
885 1543 251:0 / /var/lib/kubelet/pods/1cf68e71-cd4f-11e8-a50e-00259003b6e8/volumes/kubernetes.io~csi/pvc-1cf554bccd4f11e8/mount rw,relatime shared:163 - ext4 /dev/rbd0 rw,stripe=1024,data=ordered
```
$ kubectl exec -ti oim-ceph-rbd-5wdmr -c rbdplugin -- sh -c "grep rbd0 /proc/1/mountinfo"
1801 2007 253:0 / /var/lib/kubelet/pods/840d1682-cd65-11e8-9fba-deadbeef0100/volumes/kubernetes.io~csi/pvc-8017a31e-cd65-11e8-9fba-deadbeef0100/mount rw,relatime shared:547 - ext4 /dev/rbd0 rw,stripe=1024
1804 1896 253:0 / /host/var/lib/kubelet/pods/840d1682-cd65-11e8-9fba-deadbeef0100/volumes/kubernetes.io~csi/pvc-8017a31e-cd65-11e8-9fba-deadbeef0100/mount rw,relatime master:547 - ext4 /dev/rbd0 rw,stripe=1024
```
Does your deployment have the `host` volume? It's not obvious to me why
that is needed.
|
I know, a bit late, but I can also confirm that this fixed the issue :-) Any chance of publishing a new version? Or has the v0.3.0 image been updated? I'm still wondering whether it wouldn't be better to use NodeStageVolume. |
yes, new container image is published, please try it out, thanks! |
Huamin Chen <[email protected]> writes:
yes, new container image is published, please try it out, thanks!
Hmm, it was still failing. I suspect that the overlapping gRPC might
have been to blame, but did not investigate in detail. What works for me
is master+PR #92.
|
Bug 2060720: rbd: return unimplemented error for block-mode reclaimspace req
I'm running on a Kubernetes 1.11 cluster, Linux kernel 4.18.
While running the E2E test (= create PVC, use it first in one pod, then another) I noticed that the second pod got stuck in NodePublishVolume because the image was still in use (= had watchers) by the node on which the first pod ran.
After adding a bit more debug output I traced it down to:
In my case,
cnt
is 1 in that if check and thus the image remains attached to/dev/rbd0
.What exactly is the logic behind this if check?
NodePublishVolume
always attaches the images, doesn't it? IMHONodeUnpublishVolume
then also always must detach, because once it returns a success status without detaching, there won't be anotherNodeUnpublishVolume
call and the image will remain attached forever.I've tentatively commented out the if check and now the test passes, i.e.
detachRBDDevice
succeeds and the image can be used in the second pod.Note that this only seems to be a problem when the second pod gets scheduled to a different node than the first one. When trying this out manually, I could see that
/dev/rbd0
was still present after deleting the first pod. When starting the same pod again on the same node,/dev/rbd0
got mounted and the pod started fine.The text was updated successfully, but these errors were encountered: