I am currently facing a problem.
Currently I am trying to mirror the cloned image using clone v2.
Below is the information of the image I cloned.
[root@ossrccephm1 ~]# rbd info data/clone1
rbd image 'clone1':
size 1 GiB in 256 objects
order 22 (4 MiB objects)
snapshot_count: 0
id: 6752b7edc746d
block_name_prefix: rbd_data.6752b7edc746d
format: 2
features: layering, exclusive-lock, object-map, fast-diff, deep-flatten, journaling, operations
op_features: clone-child
flags:
create_timestamp: Thu Jul 20 12:20:35 2023
access_timestamp: Thu Jul 20 12:20:35 2023
modify_timestamp: Thu Jul 20 12:20:35 2023
parent: data/image1@75fcc859-c93c-437b-b6e7-0cbc5da0a415
overlap: 1 GiB
journal: 6752b7edc746d
mirroring state: enabled
mirroring global id: 75372d13-b86d-4992-8435-62f280aa1c2b
mirroring primary: true
And one thing to note here is that I removed the snapshot after cloning the image.
[root@ossrccephm1 ~]# rbd snap ls data/image1 --all
SNAPID NAME SIZE PROTECTED TIMESTAMP NAMESPACE
16 75fcc859-c93c-437b-b6e7-0cbc5da0a415 1 GiB Thu Jul 20 12:19:45 2023 trash (snap1)
19 7a093c89-b516-4ada-9e52-eb016f62ecc0 1 GiB Thu Jul 20 13:10:50 2023 trash (snap2)
And I mirrored the created image to the remote cluster, and as a result, the mirroring setup was successful, but the rbd-mirror daemon located in the remote cluster did not find the corresponding snapshot, so mirroring did not work.
2023-07-20T05:54:39.354+0000 7f1730edb640 -1 librbd::image::RefreshRequest: failed to locate snapshot: 75fcc859-c93c-437b-b6e7-0cbc5da0a415
2023-07-20T05:54:39.354+0000 7f1730edb640 -1 librbd::image::OpenRequest: failed to find snapshot 75fcc859-c93c-437b-b6e7-0cbc5da0a415
2023-07-20T05:54:39.354+0000 7f1722ebf640 -1 rbd::mirror::image_replayer::CreateImageRequest: 0x55c76eb58d20 handle_clone_image: failed to clone image data/674f9a2134e0e to clone1
It sounds like it's impossible to reference a snapshot that has been removed, so how does an image that is referencing that snapshot refer to its parent's data? I am curious about the principle of clone v2 and what actions are performed when the snapshot used in the clone is removed and falls into the trash.
I couldn't find any in-depth information about clone v2. help!
EDIT:
What I want to do is:
- set mirroring between source pool and target pool.
- create a image(image1)
- create a snapshot of image1, then the same snapshot will be created at the target cluster's image1
- make a clone image of image1's snapshot on the target cluster.
- remove the snapshot of image1 in the source cluster, then the snapshot of image1 in target cluster will be removed. But, because I made the clone image with clone v2 api at the target cluster.
- Since the clone image was referencing the removed snapshot, the actual snapshot was not completely removed and was left in the namespace trash. So, finally, the cloned image is a validly usable image.
- In this state, I tried to replicate the clone image referencing the snapshot that was removed (automatically stored in the trash namespace to be exact) by mirroring it back to the source cluster.
- In this situation, mirroring fails because the rbd-mirror daemon cannot find the removed snapshots (snapshots that currently exist in the namespace trash). Specifically, the rbd mirror image enable command completes successfully, but looking at the log of the rbd-mirror daemon, the removed snapshot is not found, so mirroring is not actually possible.
I would love to be able to find a snapshot with the rbd-mirror removed. Also, it would be nice if there was a way to revert snapshots that exist in the namespace trash. Since the flatten command is also executed, it seems correct that the removed snapshot itself is a valid snapshot, but I have not been able to find a command or method to access the snapshot.
Would you have understood my situation?
Thank you so much for reading my long question.