Repository navigation
librbd: allow cloning from non-user snapshots - #57954
Conversation
ajarr
left a comment
There was a problem hiding this comment.
PR looks good.
Why was snap ID chosen over snap name to specify the non-user snapshot to clone from?
|
Pushing a fixup for |
The snap name by itself can be ambiguous. Each non-user snapshot type forms its own namespace -- see The alternative to taking a snap ID would be to take an additional |
420070c to
d9d4371
Compare
|
jenkins test api |
|
jenkins test dashboard |
|
jenkins test dashboard |
|
jenkins test make check |
Signed-off-by: Ilya Dryomov <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Enable cloning from non-user snapshots via the CLI. Signed-off-by: Ilya Dryomov <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
|
Added release notes (had to rebase to resolve a conflict in |
|
@afreen23 or @aaSharma14 I'd appreciate your ack for changes to |
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins retest this pleasejenkins test classic perfjenkins test crimson perfjenkins test signedjenkins test make checkjenkins test make check arm64jenkins test submodulesjenkins test dashboardjenkins test dashboard cephadmjenkins test apijenkins test docsjenkins render docsjenkins test ceph-volume alljenkins test ceph-volume toxjenkins test windowsjenkins test rook e2e