dynamic-nfs-provisioner icon indicating copy to clipboard operation
dynamic-nfs-provisioner copied to clipboard

garbage collector not work as expected.

Open celiawa opened this issue 2 years ago • 1 comments

Describe the bug: A clear and concise description of what the bug is.

When the frontend PV and PVC are deleted, openebs nfs provisioner will do gc to remove the stale backend NFS resources every 5 mins. Refer to PR: https://github.com/openebs/dynamic-nfs-provisioner/pull/80 After adding debug log, found that when doing gc, the p.hook is undefined, so it did not enter the below brace to remove the finalizer, and the service, deployment and PVC are not deleted. https://github.com/openebs/dynamic-nfs-provisioner/blob/dbe24dc5607f1c187ff80af3236034061ee99e00/provisioner/helper_kernel_nfs_server.go#L526

image

From openebs-nfs-provisioner log, we can see the gc was triggered, and describe the service, deployment and backend PVC, there were deletingTimestamp in the manifest. I0829 12:11:23.270146 1 garbage_collector.go:119] Deleting stale resources for PV=pvc-71f5a361-47fa-442d-baf1-00865d7567d6 I0829 12:11:23.272453 1 helper_kernel_nfs_server.go:522] Volume pvc-71f5a361-47fa-442d-baf1-00865d7567d6 has been initialized with Service {kube-system/nfs-pvc-71f5a361-47fa-442d-baf1-00865d7567d6}. Initiating delete... I0829 12:11:23.301297 1 helper_kernel_nfs_server.go:403] Volume pvc-71f5a361-47fa-442d-baf1-00865d7567d6 has been initialized with Deployment:nfs-pvc-71f5a361-47fa-442d-baf1-00865d7567d6. Initiating delete... I0829 12:11:23.313493 1 helper_kernel_nfs_server.go:211] Volume pvc-71f5a361-47fa-442d-baf1-00865d7567d6 has been initialized with PVC {kube-system/nfs-pvc-71f5a361-47fa-442d-baf1-00865d7567d6} Initiating delete...

From this code in garbage_collector.go, no hook initialized https://github.com/openebs/dynamic-nfs-provisioner/blob/1f414468b8c53b974c5dddbe02357a6ceb97d3b9/provisioner/garbage_collector.go#L120 image

I added a fix like the below and built a new image. Verified that the service, deployment, and PVC can be deleted in GC. image

Environment details:

  • OpenEBS version (use kubectl get po -n openebs --show-labels): v0.9.0
  • Kubernetes version (use kubectl version): 1.22.4

celiawa avatar Aug 30 '22 01:08 celiawa

Hi @mynktl , could you help look at this issue? Thanks!

celiawa avatar Aug 30 '22 01:08 celiawa