-
Notifications
You must be signed in to change notification settings - Fork 159
Disk failed to relink with udevadm #608
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
Comments
Can you confirm that the PD behind the associated PV/PVC is healthy? |
It is indeed, I did |
Weird, so pod 0 must have gotten in to a weird state? Possibly the attach failed but the kubelet couldn't figure it out, and deleting the pod forced a retry. Maybe just one of those things, but I wonder if there is a race condition somewhere we're missing. |
By the time we get to the MountDevice error, I believe the Attach call should have succeded. We have seem some strange udev problems in the past where udev missed an event or didn't update its device cache. We've tried to workaround it by doing a "udev trigger" when things seem strange, but there's potentially still some scenarios where that won't help. |
This just failed again, there's definitely a regression between |
Do you mean 1.16.13-gke.1 and .401? I don't think we ever released a 1.16.3-gke.1. If so, both those versions use v0.7.0-gke.0 of the driver. If you meant 1.15.13-gke.1, then the pdcsi driver was on v0.6.0-gke.0, and potentially #459 could be playing a factor. Is this issue reliably reproducible? Are you able to ssh to the node and inspect the local path to the PD and what its udev link and scsi 83 page says? |
Indeed, I upgraded the cluster to |
Also hit the same issue. One thing interesting is I found my CSIDriver object is misconfigured.
The attachrequired field should set to true. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
Stale issues rot after 30d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
I am facing the same issue I believe.
I have enabled the CSI using this. It's using the csi driver |
/lifecycle frozen |
Any update on this issue. This is easily reproducible and hitting us frequently |
@madhurnawandar can you post steps to get a repro here? |
@mattcary Hey
We have tried upgrading gce-pd-csidriver to the latest stable and still the issuer is the same.
Any clues? |
@umeshkumhar We haven't had a chance to reproduce it. Are you able to come up with even an intermittently reproducing test case? |
@mattcary We just install helm chart for MongoDB, Redis and MySQL with PVCs in a single namespace, At random any PVC will fail and block out ginkgo test execution, It somethings works fine, that is 1 in 20 execution. We also tried re-creating new GKE cluster with 1.18.20-gke.901 Please suggest something, its a blocker for us. |
Looks like I'm having the same issue
|
I'm facing this issue on pre-emptible node pool, whever a node was preempt, the pods status is changing to ContainerCreating and stuck on mount device
any update yet on this issue? |
We are actively looking into several related issues. Do you have a reliable reproduction recipie? Thx. |
i have the same problem on gke, it usually happens on preempted node with statefulset pvc template. it seems to be related to the node and i can always fix it by draining the node where the pod scheduled on. |
We are also hitting this with pre-emptible node pools, post pre-emption. GKE 1.22 Edit: Deleting the pods would get them stuck in terminating, deleteting with --force, removed them but on recreation they would fail the same way. Only way to fix this for us was to manually delete the instances and scale the node pool back up, to recreate the ndoes. |
We have seen some cases where the disk is attached to the host machine, but a deadlock is happening in the guest OS that is preventing the device from appearing in sysfs (which then explains the error messages above, where the device can't be found). However we have not been able to reproduce this in order to figure out the root cause. So any further clues you can give would be helpful. The first thing is to identify if this is the same problem: does the PD fail to appear in /dev/disk/by-id? Is the device missing from lsscsi or /sys/class/scsi_disk? (it's hard to positively identify a missing disk, all I've been able to do is count the number of scsi devices and see if it matches what is supposed to be attached to the VM, eg from gcloud compute instances describe). If so, look in dmesg for something like "virtio_scsi: SCSI device 0 0 176 0 not found". Look for stuck kworker threads (ie, kworker threads in state "D" in ps). If there's such a stuck thread, look in /proc//stack for something like "INFO: task kworker/6:9:2470111 blocked for more than 327 seconds" and long stack traces including __scsi_add_disk or __scsi_remove_disk. If so, it's a similar problem, and we'd appreciate more information on how this is happening, including your machine shape, number of attached devices, number of pods on the node, etc. |
Alright, I'm upgrading from 1.22.6-gke.200 to 1.22.8-gke.200 (which already includes #951 from what I can see). I'll report back if the problem happens again. |
Same issue on 1.22.8-gke.200. Edit: same on |
We've been running into this for a few months now as well (currently on 1.22.7). We'll upgrade and report back again, but happy to investigate together on our cluster(s) if that's helpful! |
This issue is super annoying and I hope it will be fixed soon, but in the meantime, you can use this piece I code I've written:
When deployed as a container in Kubernetes, every 10min, it :
Hope it helps. |
I think the several recent comments should actually refer to #987. While I appreciate the feedback from the community, it would be helpful to read the contents of the bug and try to be accurate about where to post. It's not very helpful if we spend more time figuring out which comments are attached to which issue than working on the problem. |
/kind bug |
@mattcary
We think the problem is the VM cannot disconnect the disk. We find that
[ 605.518214] INFO: task kworker/8:34:16931 blocked for more than 241 seconds.
[ 605.526795] Not tainted 5.15.0-47-generic #51-Ubuntu
[ 605.533775] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[ 605.543112] task:kworker/8:34 state:D stack: 0 pid:16931 ppid: 2 flags:0x00004000
[ 605.543114] Workqueue: events_freezable virtscsi_handle_event [virtio_scsi]
[ 605.543117] Call Trace:
[ 605.543118] <TASK>
[ 605.543119] __schedule+0x23d/0x590
[ 605.543121] ? class_dir_release+0xe/0x20
[ 605.543124] schedule+0x4e/0xc0
[ 605.543126] blk_mq_freeze_queue_wait+0x6d/0xa0
[ 605.543128] ? wait_woken+0x70/0x70
[ 605.543131] del_gendisk+0x1c0/0x270
[ 605.543133] sd_remove+0x45/0x90
[ 605.543135] __device_release_driver+0x287/0x2a0
[ 605.543137] device_release_driver+0x29/0x40
[ 605.543138] bus_remove_device+0xde/0x150
[ 605.543140] device_del+0x19c/0x400
[ 605.543141] __scsi_remove_device+0x12c/0x170
[ 605.543143] scsi_remove_device+0x27/0x40
[ 605.543145] virtscsi_handle_event+0x133/0x2b0 [virtio_scsi]
[ 605.543146] process_one_work+0x22b/0x3d0
[ 605.543148] worker_thread+0x53/0x420
[ 605.543149] ? process_one_work+0x3d0/0x3d0
[ 605.543150] kthread+0x12a/0x150
[ 605.543152] ? set_kthread_struct+0x50/0x50
[ 605.543154] ret_from_fork+0x22/0x30
[ 605.543156] </TASK>
---
[ 1881.223689] Showing busy workqueues and worker pools:
[ 1881.223691] workqueue events_freezable: flags=0x4
[ 1881.223692] pwq 16: cpus=8 node=0 flags=0x0 nice=0 active=8/256 refcnt=9
[ 1881.223695] in-flight: 16931:virtscsi_handle_event [virtio_scsi], 16944:virtscsi_handle_event [virtio_scsi], 16933:virtscsi_handle_event [virtio_scsi], 16961:virtscsi_handle_event [virtio_scsi], 17488:virtscsi_handle_event [virtio_scsi], 16907:virtscsi_handle_event [virtio_scsi], 17527:virtscsi_handle_event [virtio_scsi], 16938:virtscsi_handle_event [virtio_scsi]
[ 1881.223740] pool 16: cpus=8 node=0 flags=0x0 nice=0 hung=0s workers=11 idle: 17451 16904 17531 We create 11 pods on a node, and for these 11 pods, each pod mounts a PVC (with GCP standard PD, Size 30Gi) # CPU test
stress-ng --cpu 3 --backoff 10000000 --timeout 600s
# memory test
stress-ng --vm 1 --vm-keep --vm-bytes 6G
# fio test
fio --name io-stress --eta-newline=5s --filename=/tmp/fio.temp --rw=randrw --size=2g --io_size=50g --blocksize=8k --ioengine=libaio --fsync=1000 --iodepth=10 --direct=1 --numjobs=20 --runtime=600 These 11 pods are running for two minutes, then removing these 11 pods and recreating the new 11 pods. |
Thanks, that confirms what we have found internally. GCE is pushing out a fix for a problem where if a PD is detached while there is in-flight IO, the node becomes poisioned and can no longer attach any PDs. The only solution is to delete the node. The fix for this is being rolled out, but the process is slow and will not be across the whole fleet until the beginning of next year if I understand correctly. |
The other half of the issue is why the PD was not able to be cleanly unmounted before detach. kubernetes/kubernetes#110721 may help avoid that, but it seems like there may still be an issue of container teardown or unmount taking too long. |
Thank you @mattcary
This is sad.
Where can we know the roll out plan? |
Yeah :-/
If I understand correctly, the fix is currently in experiment now, which means that random VMs are getting the fix. There is no public tracking of this fix that I know of unfortunately. |
Hi @mattcary , are you aware of a workaround we might be able to use until the experimental fix is GA? 🙏 It's pretty common for us to run into this issue, because we often detach and attach new PVCs to existing nodes (one PVC for each workload). |
You should only be running into this problem if you're detaching disks while IO is in flight. K8s doesn't do that normally---it waits for a clean unmount---and so it's only in a very particular situation where this happens (queuing or other behavior on the kubelet leading to the 6m force detach flow). I'm trying to be precise here about the distinction from detach and unmount. Unmounting while IO is in flight won't case this problem; it may cause problems for the filesystem but from the block device level once the system unmounts there won't be IO and so detach is safe. Hence sipmly terminating pods doesn't cause this error. Attaching and detaching PVCs to existing nodes will not normally cause this behavior. So that may mean something else is going on---in which case this fix isn't going to help you. To reiterate, you're only hitting this problem if you're detaching disks (either manually, or because of nodes getting into an unusually overloaded state) while there is active IO on the device. Normal PVC workflows do not cause this behavior as far as we've seen. Of course you may have found a new corner case, so please post details of your problems. But I suspect that this is not your issue. |
@mattcary How can we identify the node that goes into the unusually overloaded state? Will the node state change to NotReady because the node has disk pressure? Note: we monitored the node state, but none ever went into the NotReady state when we performed the testing. |
This is being done as a temporary workaround for kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#608 that we're constantly seeing in the CI environment in GCP Signed-off-by: Oren Cohen <[email protected]>
This is being done as a temporary workaround for kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#608 that we're constantly seeing in the CI environment in GCP Signed-off-by: Oren Cohen <[email protected]>
This is being done as a temporary workaround for kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#608 that we're constantly seeing in the CI environment in GCP Signed-off-by: Oren Cohen <[email protected]>
This is being done as a temporary workaround for kubernetes-sigs/gcp-compute-persistent-disk-csi-driver#608 that we're constantly seeing in the CI environment in GCP Signed-off-by: Oren Cohen <[email protected]>
It hasn't shown up in the kubelet monitored bits. The thing to look for is in the attacher controller logs in the kube-controller for lots of attach/detach operations, maybe taking a long time (> 30s), and the attacher controller doing a force detach. |
/close The poisoned node fix is rolled out. We have seen sporadic reports of other device related problems, but they seem to not be related to this bug so it would be better to start a new issue for them. |
@mattcary: Closing this issue. In response to this:
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. |
That solved it. Thanks @lapcchan
|
I've been running a database cluster with a statefulset for a number of months of GKE. Yesterday I upgraded to to regular channel version
1.16.13-gke.401
and today I found that that statefulset had its first pod with this indescribe pod
:The text was updated successfully, but these errors were encountered: