-
Notifications
You must be signed in to change notification settings - Fork 546
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
Cleanup snapshots before removing rbd image #3456
Conversation
Ceph csi couldn't remove pvc with snapshots that was created directly in ceph using rbd or other clients. As a result, the rbd image remains permanently in the trash. Fixes: ceph#3416 Signed-off-by: ruslanloman <ruslanloman@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure this is what all users want. Some users might still want to use the snapshot, even when someone/thing else deleted the volume. Having the snapshot available, and the parent rbd image in the trash makes it possible to undo unintentional deletions (for example).
|
||
snaps, err := ri.listSnapshots() | ||
if err != nil { | ||
log.DebugLog(ctx, "rbd: failed to get list of snapshots %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return the error?
why cephcsi need to handle the user created snapshots? if user is creating the snapshot its user responsibility to delete it also #3416, having this feature can also lead to similar changes for others also like Replication, cephfs subvolume deletion etc (just an example). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We still had discussions going on the issue thread?
why does cephcsi need to handle the user created snapshots? if user is creating the snapshot its user responsibility to delete it also
+1
We cannot guarantee such behavior, when another external entity acts on cephcsi managed images.
We cannot purge snapshots of a pvc having k8s snapshot and clone. These preserve the link between parent and child
Hi, thank you for your comments! With this PR i'm trying to find some solution for this issue. Because right now cephcsi couldn't remove the ceph rdb image with snapshots and we can consider it as a bug.
|
I don't think this is a bug, I would probably call it intentional behaviour. It might be unexpected for some users, but Ceph-CSI should not, and does not delete volumes or snapshots that were created by others.
I think option 2 is the most reasonable. Ceph-CSI should not (never) be able to get blamed for data-loss, and wrongly configuring a "force snapshot removal" option invites that (even if it is an admin/user error). Option 2 makes sure that the user/admin notices their unbalanced usage of Ceph-CSI and other tools. The user/admin should then decide to correct the cooperation of the tools/procedures. |
Hi @nixpanic I got your point. I'm going to close this PR as invalid. |
Hello!
Describe what this PR does
Ceph csi couldn't remove pvc with snapshots that was created directly in
ceph using rbd or other clients. As a result, the rbd image remains permanently in the trash.
As solution we can cleanup snapshots before removing rbd image.
Related issues
Fixes: #3416