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

use trash to remove RBD images asynchronously #80

Merged
merged 2 commits into from
Dec 13, 2024
Merged

Conversation

ushitora-anqou
Copy link
Contributor

@ushitora-anqou ushitora-anqou commented Dec 12, 2024

We should remove RBD images asynchronously to finish each reconiliation
iteration quickly. This commit supports asynchronous removal of the RBD
images by the following two steps:

  1. Run rbd trash mv to move the RBD image to trash.
  2. Run ceph rbd task add trash remove to add a task to remove an image
    from trash.

cf. https://github.com/ceph/ceph-csi/blob/d8a040719e0ad491ad144fe361b67e6bd2109710/docs/design/proposals/rbd-snap-clone.md#rbd-cli-commands-to-delete-a-snapshot

This commit makes the following changes:

- RBDInfo struct is renamed to RBDImageInfo.
- RBDImageInfo's Parent field becomes optional.
- RBDImageInfo come to have an ID field.

Note that the callers of this function should check that the Parent field
of the result is not nil if they want to use it, because it's now
optional and a nillable pointer.

Signed-off-by: Ryotaro Banno <ryotaro.banno@gmail.com>
We should remove RBD images asynchronously to finish each reconiliation
iteration quickly. This commit supports asynchronous removal of the RBD
images by the following two steps:

1. Run `rbd trash mv` to move the RBD image to trash.
2. Run `ceph rbd task add trash remove` to add a task to remove an image
   from trash.

cf. https://github.com/ceph/ceph-csi/blob/d8a040719e0ad491ad144fe361b67e6bd2109710/docs/design/proposals/rbd-snap-clone.md#rbd-cli-commands-to-delete-a-snapshot

Signed-off-by: Ryotaro Banno <ryotaro.banno@gmail.com>
@ushitora-anqou ushitora-anqou marked this pull request as ready for review December 12, 2024 09:17
@satoru-takeuchi satoru-takeuchi merged commit b086293 into main Dec 13, 2024
3 checks passed
@satoru-takeuchi satoru-takeuchi deleted the use-trash-mv branch December 13, 2024 00:52
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

Successfully merging this pull request may close these issues.

2 participants