]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: Remove old non-primary demoted image snapshots on the local cluster 68500/head
authorMiki Patel <miki.patel132@gmail.com>
Tue, 21 Apr 2026 11:53:29 +0000 (17:23 +0530)
committerSuper User <root@li-4c4c4544-0051-4710-8053-c6c04f423534.ibm.com>
Wed, 24 Jun 2026 17:41:46 +0000 (23:11 +0530)
commit5a77c4fd359e485501256fa3b21272fb06e8f0af
tree1dd927bed1ae9ce9ee43355febf91269af60b583
parent1939c6dbc5f3c4a25cf6ff2f6a0a59b317dcdfcf
rbd-mirror: Remove old non-primary demoted image snapshots on the local cluster

When an image is demoted on primary cluster and later promoted again,
a non-primary demoted image snapshot is created on the peer (secondary)
cluster. Each such promote/demote cycle on same cluster results in an
additional non-primary demoted snapshot being created on peer.
As a result, repeated promote/demote cycles on the same cluster can
lead to accumulation of stale non-primary demoted snapshots on the
secondary cluster. These snapshots are not removed immediately because
cleanup is only triggered when peer (secondary) is promoted and then
demoted.

The proposed changes ensures that such snapshots are proactively identified
and removed, preventing unbounded buildup. Also added test coverage to
verify cleanup behavior.

Fixes: https://tracker.ceph.com/issues/76155
Signed-off-by: Miki Patel <miki.patel132@gmail.com>
qa/workunits/rbd/rbd_mirror.sh
src/test/rbd_mirror/image_replayer/snapshot/test_mock_Replayer.cc
src/tools/rbd_mirror/image_replayer/snapshot/Replayer.cc