Skip to content

Conversation

@idryomov
Copy link
Contributor

idryomov added 10 commits June 14, 2024 09:20
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)
@idryomov idryomov added this to the v19.1.1 milestone Jun 14, 2024
@idryomov idryomov requested review from a team as code owners June 14, 2024 07:29
@idryomov idryomov requested review from aaSharma14 and avanthakkar and removed request for a team June 14, 2024 07:29
@idryomov idryomov merged commit c4ba69d into ceph:squid Jun 20, 2024
@idryomov idryomov deleted the wip-64662-squid branch June 20, 2024 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants