Finalizer on the snapshot source PVC?

8 views
Skip to first unread message

David Su

unread,
Jan 2, 2020, 8:01:54 PM1/2/20
to kubernetes-sig-storage-wg-csi
Hi all,
I noticed that in this doc, https://github.com/kubernetes/enhancements/blob/master/keps/sig-storage/20190709-csi-snapshot.md , it mentioned: "Added Finalizer on the snapshot source PVC to prevent it from being deleted when a snapshot is being created from it."  

Does anyone know what k8s/snapshot sidecar version starts to support this feature? Or it will be in the GA release? Also, does the finalizer has the ref count mechanism to know how many snapshots are still associated with the source PVC? 

Thanks,
Chun-Yi

Xing Yang

unread,
Jan 2, 2020, 8:53:51 PM1/2/20
to David Su, kubernetes-sig-storage-wg-csi
This finalizer is added in the 1.2.0 release. It does not keep a ref count.  It just checks if there's any snapshot still being created from the PVC.

Thanks,
Xing

--
You received this message because you are subscribed to the Google Groups "kubernetes-sig-storage-wg-csi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-sig-stora...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubernetes-sig-storage-wg-csi/CAHSBy%3DGhFvLSYSTJHbR2XtqbNvm-E76ZT1%2Bj%2BQ6TefqiNkt0Pw%40mail.gmail.com.

David Su

unread,
Jan 3, 2020, 1:22:27 PM1/3/20
to Xing Yang, kubernetes-sig-storage-wg-csi
Hi Xing Yang,
I don't quite understand how the finalizer works without a ref count. I was assuming the source PVC can be removed only if all snapshots are removed. 

Thanks,
Chun-Yi

Xing Yang

unread,
Jan 3, 2020, 2:56:17 PM1/3/20
to David Su, kubernetes-sig-storage-wg-csi

Hi Chun-Yi,


This finalizer may not be what you are looking for.  It only prevents the PVC from being deleted if there a snapshot actively being created from it. 


Are you looking for a finalizer that will be preventing a PVC from being deleted as long as there is a snapshot created from it?


Thanks,

Xing

David Su

unread,
Jan 3, 2020, 3:22:12 PM1/3/20
to Xing Yang, kubernetes-sig-storage-wg-csi
Hi Xing Yang,
Yes, I am looking for the 2nd finalizer you mentioned. It depends on how a snapshot is implemented. If a snapshot does not rely on the source volume to restore. We probably don't need this kind of finalizer.
If a snapshot requires the source volume to restore, then with a ref count make more sense because snapshots won't work after the source volume is gone. The CSI driver should return the FAILED_PRECONDITION error when there are snapshots associated with the deleting volume. According to the CSI spec here.  However, I wonder if there exists a finalizer like this to prevent calling the VolumeDelete to check the backend storage's associated snapshots, the operation could be expensive if you have thousands of snapshots per volume. Hope this makes sense.

Thanks,
Chun-Yi

    


Xing Yang

unread,
Jan 3, 2020, 7:56:01 PM1/3/20
to David Su, kubernetes-sig-storage-wg-csi
Hi Chun-Yi,

There's no such Finalizer right now.  We discussed about this issue before and decided to let driver handle it.  Basically driver could keep track of whether a snapshot has already been deleted from Kubernetes, but only really deletes it from the storage system when the volume itself is also deleted.

However we have got lots of requests for this as many storage systems do have this dependency between snapshot and volume.  We should think about how to handle this better.  We discussed about this briefly when moving snapshot from alpha to beta but didn't have time to get to the bottom of it.  There's also an issue opened for this earlier: https://github.com/kubernetes-csi/external-snapshotter/issues/115.  Feel free to add comments to the existing issue or open a new one so that we keep track of it.

Thanks,
Xing

David Su

unread,
Jan 6, 2020, 1:02:49 PM1/6/20
to Xing Yang, kubernetes-sig-storage-wg-csi
HI Xing Yang,
Thanks for the explanation. I'll give comments about our thoughts about this issue.

Best,
Chun-Yi.

  
Reply all
Reply to author
Forward
0 new messages