From: Prasanna Kumar Kalever Date: Tue, 16 Dec 2025 13:47:26 +0000 (+0530) Subject: rbd-mirror: avoid deleting image snapshots that are part of a group snapshot X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9236ecf2b46ef6172987dee48f9934e3eb4b95c7;p=ceph-ci.git rbd-mirror: avoid deleting image snapshots that are part of a group snapshot On daemon restart, the image replayer currently deletes and recreates image snapshots if object copying has not yet started, in order to avoid missing image state such as object-map or metadata. This logic is unnecessary for image snapshot part of mirror group snapshots. By the time a group snapshot reaches GROUP_SNAPSHOT_STATE_CREATED, all member image snapshots are already guaranteed to be in the CREATED state. Deleting such image snapshots provides no benefit and can cause group snapshots to become stuck (in current case) waiting for such image snapshots. Skip image snapshot deletion when the snapshot is part of a group snapshot. A follow-up commit will address handling group snapshots that remain in GROUP_SNAPSHOT_STATE_CREATING across a daemon restart by deleting and allowing the syncing recreating the group snapshot as a whole. Signed-off-by: Prasanna Kumar Kalever --- diff --git a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc index f951f88b56e..e81d5b7df0c 100644 --- a/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc +++ b/src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc @@ -518,9 +518,11 @@ void Replayer::scan_local_mirror_snapshots( // the first non-primary snapshot since we know its snapshot is // well-formed because otherwise the mirror-image-state would have // forced an image deletion. - m_prune_snap_ids.clear(); - m_prune_snap_ids.insert(local_snap_id); - break; + if (!mirror_ns->group_spec.is_valid()) { + m_prune_snap_ids.clear(); + m_prune_snap_ids.insert(local_snap_id); + break; + } } else { // start snap will be last complete mirror snapshot or initial // image revision