]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commit
rbd-mirror: allow incomplete demote snapshot to sync after rbd-mirror daemon restart
authorVinayBhaskar-V <vvarada@redhat.com>
Tue, 14 Oct 2025 11:47:37 +0000 (17:17 +0530)
committerIlya Dryomov <idryomov@redhat.com>
Sat, 22 Nov 2025 16:46:48 +0000 (17:46 +0100)
commitb80f3926411f0de9d73d118d013319c72ef8cd14
tree6f547d56f879df95dd2c4bfc874b886b2e5c5efd
parente075bf36d8313d0053ba03e3630fc2fb7095b6a9
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>
(cherry picked from commit 636a3929c1a4052827660f44f35842ac62f6d69a)

Resolves: rhbz#2416554
qa/workunits/rbd/rbd_mirror.sh
qa/workunits/rbd/rbd_mirror_helpers.sh
src/librbd/mirror/GetInfoRequest.cc