kubernetes-csi / external-snapshotter

Sidecar container that watches Kubernetes Snapshot CRD objects and triggers CreateSnapshot/DeleteSnapshot against a CSI endpoint.
Apache License 2.0
502 stars 375 forks source link

Need to discuss how to handle the case when a PV is deleted while creating a VolumeGroupSnapshot #1183

Open xing-yang opened 3 weeks ago

xing-yang commented 3 weeks ago

What happened: This was brought up during the code review: https://github.com/kubernetes-csi/external-snapshotter/pull/1171#discussion_r1826010750. If a PV is deleted while creating a VolumeGroupSnapshot, should we bail out and fail the entire VolumeGroupSnapshot creation or should we continue and just leave the field for PV empty. If we do the later, that means we don't have a way to restore the PV that got deleted.

What you expected to happen:

How to reproduce it:

Anything else we need to know?:

Environment:

yati1998 commented 2 weeks ago

in my opinion it would be better to return error that pv has been deleted. Let me know how do you want it to work cc @xing-yang also please feel free to tag people who could answer it better and lets work on it.

yati1998 commented 2 weeks ago

@jsafrane any decision or suggestion on this?

jsafrane commented 1 week ago

I think it's fair to create a VolumeSnapshotContent + VolumeSnapshot for such a snapshot, and not to refer to a PV / PVC in them. It's up to the user to figure out what data is on the snapshot. I think the current implementation is written this way.