Skip to content
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

garbage collector not work as expected. #143

Open
celiawa opened this issue Aug 30, 2022 · 1 comment
Open

garbage collector not work as expected. #143

celiawa opened this issue Aug 30, 2022 · 1 comment

Comments

@celiawa
Copy link

celiawa commented Aug 30, 2022

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: #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
Copy link
Author

celiawa commented Aug 30, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant