]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
rbd-mirror: allow incomplete demote snapshot to sync after rbd-mirror daemon restart 65953/head
authorVinayBhaskar-V <vvarada@redhat.com>
Tue, 14 Oct 2025 11:47:37 +0000 (17:17 +0530)
committerVinayBhaskar-V <vvarada@redhat.com>
Thu, 30 Oct 2025 19:10:00 +0000 (00:40 +0530)
commit636a3929c1a4052827660f44f35842ac62f6d69a
treeea42d2005603c946784e10fea96c1bc6f60793de
parentc4168074508624bda97fbe374f0c76e5b64c5b6e
rbd-mirror: allow incomplete demote snapshot to sync after rbd-mirror daemon restart

Currently when the rbd-mirror daemon on secondary was killed while a demote snapshot was newly created (0% copied)
or partially synced, the image's promotion state was set to **PROMOTION_STATE_ORPHAN** upon restart of rbd-mirror
daemon on secondary. This state prevents the demote snapshot sync after restart as bootstrap on secondary fails.
In this commit we fix this by assigning promotion state to **PROMOTION_STATE_NON_PRIMARY**
for an image with an **incomplete non-primary demote snapshot**.

The downside is that if the image is removed on the primary cluster, then after restart of
rbd-mirror daemon on secondary cluster, the corresponding image on the secondary also gets removed.
This is because deletion propagation is unconditionally enabled precisely for **PROMOTION_STATE_NON_PRIMARY**
images and this is okay since the user would have deleted the primary demoted image forcefully.

Fixes: https://tracker.ceph.com/issues/73528
Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
qa/workunits/rbd/rbd_mirror.sh
qa/workunits/rbd/rbd_mirror_helpers.sh
src/librbd/mirror/GetInfoRequest.cc