-
Notifications
You must be signed in to change notification settings - Fork 6.3k
squid: librbd: allow cloning from non-user snapshots #58044
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit 53799d0)
With an error check for p_snap_name, it doesn't make much sense to crash if "either p_id or p_name" contract is violated. Replace the assert with a similar error check. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit d6eafaf)
Propagate everything there is in rbd_linked_image_spec_t and rbd_snap_spec_t structures returned by the C API. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit 533943d)
Allow cloning from non-user snapshots -- namely snapshots in group
and mirror namespaces. The motivation is to provide a building block
for cloning new groups from group snapshots ("rbd group snap create").
Otherwise, group snapshots as they are today can be used only for
rolling back the group as a whole, which is very limiting.
While at it, there doesn't seem to be anything wrong with making it
possible to clone from mirror snapshots as well.
Snapshots in a trash namespace can't be cloned from since they are
considered to be deleted.
Cloning from non-user snapshots is limited to clone v2 just because
protecting/unprotecting is limited to snapshots in a user namespace.
This happens to simplify some invariants.
Fixes: https://tracker.ceph.com/issues/64662
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit d7fd66e)
Make it clear that these are pool IDs, referring to the same pool(s) as parent/child_pool_name fields. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit 4467065)
Make ARGUMENT_MODIFIER_DEST synonymous to ARGUMENT_MODIFIER_NONE as there is no use case for a destination snap ID for now. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit aa1f598)
Enable cloning from non-user snapshots via the CLI. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit 06c0dd2)
The intent of "rbd ls | grep -v clone" was probably to check that an image with the name "clone" shows up in rbd2 pool and not in rbd pool. However, it's very far from that -- "grep -v clone" would succeed regardless because of an image with the name "test1" in rbd pool. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit fa29a6e)
The existing rbd_snap_get_trash_namespace() API returns only the original name of the deleted snapshot, omitting its namespace type. While non-user snapshots have distinctive names, there is nothing preventing the user from creating user snapshots with identical names (i.e. starting with ".group" or ".mirror" prefix). After cloning from non-user snapshots is allowed, it's possible for such user snapshots to get mixed up with non-user snapshots in the trash, so let's provide means for disambiguation. Signed-off-by: Ilya Dryomov <idryomov@gmail.com> (cherry picked from commit ed09f34)
Before (snap 22 comes from "rbd group snap create", snap 23 created
manually with "rbd snap create"):
SNAPID NAME SIZE PROTECTED TIMESTAMP NAMESPACE
21 f7cfdcfe-5f71-40e4-be82-3fb0e7caf2aa 1 GiB Mon Jun 10 09:23:40 2024 trash (mysnap)
22 bd67397f-32cb-48fe-b1ac-ef6f02319239 1 GiB Mon Jun 10 09:26:06 2024 trash (.group.2_1491b049b556_1497bf66f586)
23 27a5f053-8431-428e-ab33-be9d8b6cf51e 1 GiB Mon Jun 10 09:28:30 2024 trash (.group.2_1491b049b556_1497bf66f586)
After:
SNAPID NAME SIZE PROTECTED TIMESTAMP NAMESPACE
21 f7cfdcfe-5f71-40e4-be82-3fb0e7caf2aa 1 GiB Mon Jun 10 09:23:40 2024 trash (user mysnap)
22 bd67397f-32cb-48fe-b1ac-ef6f02319239 1 GiB Mon Jun 10 09:26:06 2024 trash (group .group.2_1491b049b556_1497bf66f586)
23 27a5f053-8431-428e-ab33-be9d8b6cf51e 1 GiB Mon Jun 10 09:28:30 2024 trash (user .group.2_1491b049b556_1497bf66f586)
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
(cherry picked from commit e5c3dd3)
ajarr
approved these changes
Jun 14, 2024
Contributor
Author
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
backport tracker: https://tracker.ceph.com/issues/66472
backport of #57954
parent tracker: https://tracker.ceph.com/issues/64662